2016-11-09 71 views
3

我想爲詩人樣本運行Tensorflow。我通過如下:tensorflow retrain.py app.run()得到意想不到的關鍵字參數'argv'

python examples/image_retraining/retrain.py --bottlenext_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

我得到的錯誤

File "examples/image_retraining/retrain.py", line 1013, in <module> tf.app.run(main=main, argv=[sys.argv[0]] + unparsed) TypeError: run() got an unexpected keyword argument 'argv'

當我檢查app.py它顯示的argv作爲參數源。據t。 版本我正在運行0.11.0rc0

任何想法?

+0

你可以提供關於構建過程的更多細節嗎?我看到[這個問題](http://stackoverflow.com/questions/40357548/inception-v3-guide-on-tensorflow-broken-for-c-and-python)被推薦爲TF GitHub站點的錯誤報告。 [這篇文章](http://stackoverflow.com/questions/40467893/running-mnist-softmax-py-on-tensorflow-installed-with-docker)遇到了Docker的問題。 – Prune

+0

謝謝。我用conda安裝成virtualenv。我只是嘗試使用命令「conda install -c conda-forge tensorflow」重新安裝。它安裝了版本0.11.0rc2 – JerryKur

回答

6

我以前有同樣的問題。從其他分支下載示例修復了它。

git clone -b r0.11 https://github.com/tensorflow/tensorflow.git 
+1

你剛剛使用新的retrain.py文件,還是從源代碼構建它? – JerryKur

+0

切換到您發佈的版本解決了問題。謝謝。 – JerryKur

-1

您也可以通過指定使用的Git命令檢出只是工作fully_connected_feed.py從r0.11分支文件:

git checkout 5b18edb fully_connected_feed.py

注意:你需要在MNIST /目錄使用此命令

0

請檢查您的示例版本。我遇到了同樣的問題,最終解決了這個問題。我發現我的tf版本是0.11,但是我下載了主版本, 然後我比較了代碼的差異。

相關問題