4
我已經從教程here中的鏈接下載了CIFAR10代碼,並試圖運行本教程。我用命令運行它tensorflow cifar10教程失敗
python cifar10_train.py
它開始正常並按預期下載數據文件。當它試圖打開它失敗,出現以下跟蹤輸入文件:
Traceback (most recent call last):
File "cifar10_train.py", line 120, in <module>
tf.app.run()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 43, in run
sys.exit(main(sys.argv[:1] + flags_passthrough))
File "cifar10_train.py", line 116, in main
train()
File "cifar10_train.py", line 63, in train
images, labels = cifar10.distorted_inputs()
File "/notebooks/Python Scripts/tensorflowModels/tutorials/image/cifar10/cifar10.py", line 157, in distorted_inputs
batch_size=FLAGS.batch_size)
File "/notebooks/Python Scripts/tensorflowModels/tutorials/image/cifar10/cifar10_input.py", line 161, in distorted_inputs
read_input = read_cifar10(filename_queue)
File "/notebooks/Python Scripts/tensorflowModels/tutorials/image/cifar10/cifar10_input.py", line 87, in read_cifar10
tf.strided_slice(record_bytes, [0], [label_bytes]), tf.int32)
TypeError: strided_slice() takes at least 4 arguments (3 given)
果然,當我調查的代碼存在cifar10_input.py調用strided_slice()只有3個參數:
tf.strided_slice(record_bytes, [0], [label_bytes])
雖然tensorflow文檔確實聲明必須至少有4個參數。
什麼問題?我已經下載了最新的tensorflow(0.12),我正在運行cifar代碼的主分支。
這可能是他們的GitHub頁面上的一個問題。我看了幾個版本,他們都需要4個參數。 –
謝謝。我已經添加了關於GitHub的討論並獲得了我在下面添加的解決方案(我認爲)。我仍然有點不確定爲什麼代碼處於非工作狀態,但目前似乎正在運行。 – BobbyG