【发布时间】:2015-11-23 23:54:40
【问题描述】:
我已经运行了教程并成功地在 tensorflow 中创建了自己的神经网络实现。然后我决定再进一步添加我自己的操作,因为我需要对数据进行一些自己的预处理。我按照 tensorflow 网站上的教程添加了一个操作。在编写自己的 c++ 文件后,我成功构建了 tensorflow。然后,当我尝试从我的代码中使用它时,我得到了
'module' object has no attribute 'sec_since_midnight'
我的代码确实反映在 bazel-genfiles/tensorflow/python/ops/gen_user_ops.py 中,因此包装器确实为它正确生成。看起来我看不到导入该文件的 tensorflow/python/user_ops/user_ops.py。
现在,当我测试这个模块时,我得到了以下奇怪的行为。它不应该通过,因为我给它的预期向量与结果不匹配。但是,尽管说通过了,但也许测试永远不会执行?
INFO: Found 1 test target...
Target //tensorflow/python:sec_since_midnight_op_test up-to-date:
bazel-bin/tensorflow/python/sec_since_midnight_op_test
INFO: Elapsed time: 6.131s, Critical Path: 5.36s
//tensorflow/python:sec_since_midnight_op_test (1/0 cached) PASSED
Executed 0 out of 1 tests: 1 test passes.
There were tests whose specified size is too big. Use the --test_verbose_timeout_warnings command line option to see which ones these are.
【问题讨论】:
-
我现在也在为导入我自己的自定义操作而苦苦挣扎……请告诉我你是如何导入它的? 'bazel-genfiles/tensorflow/python/ops/gen_user'应该反映哪些变化?
标签: operation tensorflow