我正在遵循"TensorFlow for Poets“教程,当我尝试运行此命令时,我被困在图像再训练中:
sudo python3 tensorflow/tensorflow/examples/image_retraining/retrain.py
--bottleneck_dir=/tf_files/bottlenecks
--how_many_training_steps 500
--model_dir=/tf_files/inception --output_graph=/tf_files/retrained_graph.pb
--output_labels=/tf_files/retrained_labels.txt
--image_dir tf_files/flower_photos它看起来工作得很好,就像
Creating bottleneck at /tf_files/bottlenecks/roses/5960270643_1b8a94822e_m.jpg.txt
Creating bottleneck at /tf_files/bottlenecks/roses/8032328803_30afac8b07_m.jpg.txt
Creating bottleneck at /tf_files/bottlenecks/roses/14176042519_5792b37555.jpg.txt
...但最后,我得到了一个错误,
Traceback (most recent call last):
File "tensorflow/tensorflow/examples/image_retraining/retrain.py", line 1014, in <module>
tf.app.run()
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/platform/app.py", line 30, in run
sys.exit(main(sys.argv[:1] + flags_passthrough))
File "tensorflow/tensorflow/examples/image_retraining/retrain.py", line 789, in main
bottleneck_tensor)
File "tensorflow/tensorflow/examples/image_retraining/retrain.py", line 698, in add_final_training_ops
variable_summaries(layer_weights)
File "tensorflow/tensorflow/examples/image_retraining/retrain.py", line 660, in variable_summaries
tf.summary.histogram('histogram', var)
AttributeError: module 'tensorflow.python.summary.summary' has no attribute 'histogram'我在linux上使用TensorFlow,我没有安装Docker,因为它不是必须的。我不知道怎么解决这个问题,因为我还是个初学者。请帮帮我..
发布于 2016-11-18 00:39:51
显然,问题是您调用的属性在objet tensorflow.python.summary.summay中不存在。运行dir(tensorflow.python.summary.summay)以获取包含该对象的所有方法和属性的列表,因为它可能在新版本中更改了名称。
还要测试一下您是否使用了正确的类(因为summary.summary对我来说似乎很奇怪)
发布于 2016-12-21 01:51:34
tensorflow python包(sudo pip install tensorflow -- version.Update )的早期升级中似乎有一个bug。
https://stackoverflow.com/questions/40660121
复制相似问题