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