:tensorflow:错误报告给协调员:<class'tensorflow.python.framework.errors_impl.invalidargumenterror'=“”>

时间:2018-12-19 02:43:38

标签: python tensorflow machine-learning

我想使用cnn对某些图片进行分类,但是当我运行代码时,它运行了一段时间后会报告错误

我检查了我的图片处理是否正确,但是我不知道为什么总是出现错误,请帮助我!

似乎我可以运行一段代码,但很快它会报告错误:

<your current search> | eval eExpiryDate=strptime(ExpiryDate, "%m-%d-%Y") 
| eval sevenDaysHence=relative_time(now(), "+7d") 
| where eExpiryDate < sevenDaysHence

这是我的图片处理代码:

Step 0,train loss = 2.77,train accuracy = 0.00
Step 50,train loss = 2.77,train accuracy = 0.00
Step 100,train loss = 2.65,train accuracy = 0.07
Step 150,train loss = 2.42,train accuracy = 0.00
Step 200,train loss = 2.47,train accuracy = 0.13
Step 250,train loss = 2.39,train accuracy = 0.33
Step 300,train loss = 2.27,train accuracy = 0.13
Step 350,train loss = 2.43,train accuracy = 0.27
Step 400,train loss = 2.37,train accuracy = 0.20
Step 450,train loss = 2.49,train accuracy = 0.20
Step 500,train loss = 2.15,train accuracy = 0.33
INFO:tensorflow:Error reported to Coordinator: <class 'tensorflow.python.framework.errors_impl.InvalidArgumentError'>, Got 24 frames, but animated gifs can only be decoded by tf.image.decode_gif or tf.image.decode_image
         [[Node: DecodeJpeg_2 = DecodeJpeg[acceptable_fraction=0.5, channels=3, dct_method="", fancy_upscaling=true, ratio=1, try_recover_truncated=true, _device="/job:localhost/replica:0/task:0/device:CPU:0"](ReadFile_2)]]
Traceback (most recent call last):

  File "<ipython-input-1-c0bd3b69ef1e>", line 1, in <module>
    runfile('/Users/liuxueying/Documents/practice/cnn/untitled1.py', wdir='/Users/liuxueying/Documents/practice/cnn')

  File "/Users/liuxueying/anaconda3/envs/tensorflow/lib/python3.6/site-packages/spyder_kernels/customize/spydercustomize.py", line 678, in runfile
    execfile(filename, namespace)

  File "/Users/liuxueying/anaconda3/envs/tensorflow/lib/python3.6/site-packages/spyder_kernels/customize/spydercustomize.py", line 106, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)

  File "/Users/liuxueying/Documents/practice/cnn/untitled1.py", line 486, in <module>
    coord.join(threads)

  File "/Users/liuxueying/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/training/coordinator.py", line 389, in join
    six.reraise(*self._exc_info_to_raise)

  File "/Users/liuxueying/anaconda3/envs/tensorflow/lib/python3.6/site-packages/six.py", line 693, in reraise
    raise value

  File "/Users/liuxueying/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/training/queue_runner_impl.py", line 252, in _run
    enqueue_callable()

  File "/Users/liuxueying/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1205, in _single_operation_run
    self._call_tf_sessionrun(None, {}, [], target_list, None)

  File "/Users/liuxueying/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1350, in _call_tf_sessionrun
    run_metadata)

InvalidArgumentError: Got 24 frames, but animated gifs can only be decoded by tf.image.decode_gif or tf.image.decode_image
     [[Node: DecodeJpeg_2 = DecodeJpeg[acceptable_fraction=0.5, channels=3, dct_method="", fancy_upscaling=true, ratio=1, try_recover_truncated=true, _device="/job:localhost/replica:0/task:0/device:CPU:0"](ReadFile_2)]]

0 个答案:

没有答案