我是遵循这里定位的Tensorflow图像再培训教程。
当我尝试使用bazel运行这个命令时:
bazel-bin/tensorflow/examples/image_retraining/retrain --image_dir ~/flower_photos我得到以下错误:
Traceback (most recent call last):
File "/home/j/tensorflow/bazel-bin/tensorflow/examples/image_retraining/retrain.runfiles/org_tensorflow/tensorflow/examples/image_retraining/retrain.py", line 108, in <module>
import tensorflow as tf
File "/home/j/tensorflow/bazel-bin/tensorflow/examples/image_retraining/retrain.runfiles/org_tensorflow/tensorflow/__init__.py", line 24, in <module>
from tensorflow.python import *
File "/home/j/tensorflow/bazel-bin/tensorflow/examples/image_retraining/retrain.runfiles/org_tensorflow/tensorflow/python/__init__.py", line 63, in <module>
from tensorflow.python.framework.framework_lib import *
File "/home/j/tensorflow/bazel-bin/tensorflow/examples/image_retraining/retrain.runfiles/org_tensorflow/tensorflow/python/framework/framework_lib.py", line 76, in <module>
from tensorflow.python.framework.ops import Graph
File "/home/j/tensorflow/bazel-bin/tensorflow/examples/image_retraining/retrain.runfiles/org_tensorflow/tensorflow/python/framework/ops.py", line 28, in <module>
from autograd import core as ag_coreModuleNotFoundError:没有名为'autograd‘的模块
但是,当我使用python命令运行它时
python tensorflow/examples/image_retraining/retrain.py --image_dir ~/flower_photos它正确运行,不生成此错误。
我正在从~/tensorflow目录( git的顶部)运行上述两个命令。
环境:
发布于 2017-09-01 00:10:30
我解决了这个问题。没有安装autograd依赖项。这可以通过运行pip install autograd来解决。
发布于 2017-09-01 01:53:56
您必须在编译前配置TensorFlow,因此它设置了所有依赖项:./configure
https://stackoverflow.com/questions/45991520
复制相似问题