Bazel&Tensorflow:Inception v3再培训:AttributeError:'int'object attribute'\uuu doc_uu'是只读的

2024-09-27 07:26:40 发布

您现在位置:Python中文网/ 问答频道 /正文

我目前正在按照本教程重新培训Inception v3神经网络的顶层: https://www.youtube.com/watch?v=m2D02eZTB4shttps://www.tensorflow.org/tutorials/image_retraining

我已经建立了一个运行Ubuntu14.04.5 LTS64位的虚拟机

python 2.7.6

tensorflow 1.3.0版

bazel构建标签:0.5.3

但是,当我使用命令时

bazel-bin/tensorflow/examples/image_retraining/retrain --image_dir /media/myImageDir

然后我的过程就偏离了教程。安装两个软件包很容易解决安装错误。在

^{pr2}$

安装autograd和enum后,当尝试再次执行重新训练的命令时,出现以下错误:

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

文件“/home/tensorflow/tensorflow/bazel bin/tensorflow/examples/image_retraining”的第191行/retrain.runfiles/org_tensorflow/tensorflow/python/ops/variable_scope.py“如下所示:

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.
"""

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


Tags: inpyorgimagehomebintensorflowline
2条回答

我解决了这个问题,通过残酷地修改源代码!!!在

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

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

相关问题 更多 >

    热门问题