gpt4 book ai didi

python - 重新训练 Tensorflow 的 Inception v3 模型时没有反向移植错误

转载 作者:行者123 更新时间:2023-12-01 02:53:34 25 4
gpt4 key购买 nike

我一直在尝试按照此处的教程重新训练 Inception: https://www.tensorflow.org/tutorials/image_retraining 。我收到此错误“没有名为向后移植的模块”当我运行这个时

bazel-bin/tensorflow/examples/image_retraining/retrain --image_dir ~/marine_animal_species1

这是完整的回溯:

Traceback (most recent call last):

File "/home/karthik/tensorflow/bazel-bin/tensorflow/examples/image_retraining/retrain.runfiles/org_tensorflow/tensorflow/examples/image_retraining/retrain.py", line 91, in <module>
import tensorflow as tf
File "/home/karthik/tensorflow/bazel-bin/tensorflow/examples/image_retraining/retrain.runfiles/org_tensorflow/tensorflow/__init__.py", line 24, in <module>
from tensorflow.python import *
File "/home/karthik/tensorflow/bazel-bin/tensorflow/examples/image_retraining/retrain.runfiles/org_tensorflow/tensorflow/python/__init__.py", line 64, in <module>
from tensorflow.python.framework.framework_lib import *
File "/home/karthik/tensorflow/bazel-bin/tensorflow/examples/image_retraining/retrain.runfiles/org_tensorflow/tensorflow/python/framework/framework_lib.py", line 100, in <module>
from tensorflow.python.framework.subscribe import subscribe
File "/home/karthik/tensorflow/bazel-bin/tensorflow/examples/image_retraining/retrain.runfiles/org_tensorflow/tensorflow/python/framework/subscribe.py", line 26, in <module>
from tensorflow.python.ops import variables
File "/home/karthik/tensorflow/bazel-bin/tensorflow/examples/image_retraining/retrain.runfiles/org_tensorflow/tensorflow/python/ops/variables.py", line 26, in <module>
from tensorflow.python.ops import control_flow_ops
File "/home/karthik/tensorflow/bazel-bin/tensorflow/examples/image_retraining/retrain.runfiles/org_tensorflow/tensorflow/python/ops/control_flow_ops.py", line 70, in <module>
from tensorflow.python.ops import tensor_array_ops
File "/home/karthik/tensorflow/bazel-bin/tensorflow/examples/image_retraining/retrain.runfiles/org_tensorflow/tensorflow/python/ops/tensor_array_ops.py", line 33, in <module>
from tensorflow.python.util import tf_should_use
File "/home/karthik/tensorflow/bazel-bin/tensorflow/examples/image_retraining/retrain.runfiles/org_tensorflow/tensorflow/python/util/tf_should_use.py", line 28, in <module>
from backports import weakref # pylint: disable=g-bad-import-order
ImportError: No module named backports

我使用的是ubuntu 16.04。谢谢您的帮助。

最佳答案

sudo pip install backports.weakref
sudo pip3 install backports.weakref

解决了我的问题。

关于python - 重新训练 Tensorflow 的 Inception v3 模型时没有反向移植错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44485560/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com