Python 巴泽尔;Tensorflow:Inception v3再培训:属性错误:';int';对象属性'__文件&';是只读的

Python 巴泽尔;Tensorflow:Inception v3再培训:属性错误:';int';对象属性'__文件&';是只读的,python,tensorflow,neural-network,bazel,pre-trained-model,Python,Tensorflow,Neural Network,Bazel,Pre Trained Model,我目前正在按照本教程重新培训Inception v3神经网络的顶层: 我已经建立了一个运行Ubuntu 14.04.5 LTS 64位的VirtualBox python 2.7.6 tensorflow 1.3.0 bazel构建标签:0.5.3 但是,当我使用命令 bazel-bin/tensorflow/examples/image_retraining/retrain --image_dir /media/myImageDir 然后我的过程偏离了教程。出现两个导入错误,通过安装软件包

我目前正在按照本教程重新培训Inception v3神经网络的顶层:

我已经建立了一个运行Ubuntu 14.04.5 LTS 64位的VirtualBox

python 2.7.6

tensorflow 1.3.0

bazel构建标签:0.5.3

但是,当我使用命令

bazel-bin/tensorflow/examples/image_retraining/retrain --image_dir /media/myImageDir
然后我的过程偏离了教程。出现两个导入错误,通过安装软件包可以轻松解决

File "/home/tensorflow/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_core
ImportError: No module named autograd

File "/home/tensorflow/tensorflow/bazel-bin/tensorflow/examples/image_retraining/retrain.runfiles/org_tensorflow/tensorflow/python/ops/variable_scope.py", line 24, in <module>
    import enum  # pylint: disable=g-bad-import-order
ImportError: No module named enum

现在我真的不想干预这段代码,因为它不是我编写的自定义代码。我怀疑还有另一个问题,但我完全不知道它可能是什么。我希望这里有人也有类似的问题和/或能给我任何建议

我通过粗暴地修改源代码解决了这个问题

我通过粗暴地修改源代码解决了这个问题

我也遇到过这个问题,我注意到最近tensorflow中有一个关于这个问题的例子。解决方案如下:

  • 卸载枚举,如果您已经安装了它:
    sudo pip remove enum
  • 安装此兼容版本的enum:
    sudo apt get Install python-enum34
  • 再试一次

我也遇到过这个问题,我注意到最近tensorflow中有一个关于这个问题的讨论。解决方案如下:

  • 卸载枚举,如果您已经安装了它:
    sudo pip remove enum
  • 安装此兼容版本的enum:
    sudo apt get Install python-enum34
  • 再试一次

您似乎没有正确安装tensorflow,在尝试导入tensorflow时会出现错误。尝试重新安装tensorflow如果我在python解释器中导入tensorflow,尽管您似乎没有正确安装tensorflow,但它仍然有效,当您尝试导入tensorflow时会出现错误。尝试重新安装tensorflow如果我在python解释器中导入tensorflow,它仍然可以工作
Traceback (most recent call last):
File "/home/tensorflow/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/tensorflow/tensorflow/bazel-bin/tensorflow/examples/image_retraining/retrain.runfiles/org_tensorflow/tensorflow/__init__.py", line 24, in <module>
from tensorflow.python import *
File "/home/tensorflow/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/tensorflow/tensorflow/bazel-bin/tensorflow/examples/image_retraining/retrain.runfiles/org_tensorflow/tensorflow/python/framework/framework_lib.py", line 102, in <module>
from tensorflow.python.framework.importer import import_graph_def
File "/home/tensorflow/tensorflow/bazel-bin/tensorflow/examples/image_retraining/retrain.runfiles/org_tensorflow/tensorflow/python/framework/importer.py", line 30, in <module>
from tensorflow.python.framework import function
File "/home/tensorflow/tensorflow/bazel-bin/tensorflow/examples/image_retraining/retrain.runfiles/org_tensorflow/tensorflow/python/framework/function.py", line 34, in <module>
from tensorflow.python.ops import variable_scope as vs
File "/home/tensorflow/tensorflow/bazel-bin/tensorflow/examples/image_retraining/retrain.runfiles/org_tensorflow/tensorflow/python/ops/variable_scope.py", line 191, in <module>
"""
AttributeError: 'int' object attribute '__doc__' is read-only
AUTO_REUSE.__doc__ = """
When passed in as the value for the `reuse` flag, AUTO_REUSE indicates that
get_variable() should create the requested variable if it doesn't exist or, if
it does exist, simply return it.
"""