开心按下小绿键,哭着面对一片红
猫狗识别
在b站找了别人分享的代码,想复现一下代码,复现的原代码是tensorflow1.0的版本,我是2.0的
主要用的pycharm,但如果知道jupyter怎么解决,也请不吝赐教!我也可转jupyter
程序已经加了
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
兴高采烈地按了小绿键,结果出现一片红,我人傻了
loss和accuracy的图也出不来
那片红海就是下面这串
WARNING:tensorflow:From D:\Anaconda\anaconda\lib\site-packages\tensorflow\pythohttps://img-mid.csdnimg.cn/release/static/image/mid/ask/306899203146114.png "#left")
n\compat\v2_compat.py:96: disable_resource_variables (from tensorflow.python.ops.variable_scope) is deprecated and will be removed in a future version.
Instructions for updating:
non-resource variables are not supported in the long term
2022-01-04 21:18:32.242349: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN)to use the following CPU instructions in performance-critical operations: AVX AVX2
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2022-01-04 21:18:35.267761: W tensorflow/core/framework/op_kernel.cc:1767] OP_REQUIRES failed at whole_file_read_ops.cc:116 : Unknown: NewRandomAccessFile failed to Create/Open: D:/PyCharm/create/try/catdog/data/train/cats : �ܾ����ʡ�
; Input/output error
关掉绘图的窗口就变成下面这串问题了
Traceback (most recent call last):
File "D:/PyCharm/create/try/catdog/training.py", line 102, in <module>
coord.join(threads) # 等待所有线程结束
File "D:\Anaconda\anaconda\lib\site-packages\tensorflow\python\training\coordinator.py", line 389, in join
six.reraise(*self._exc_info_to_raise)
File "D:\Anaconda\anaconda\lib\site-packages\six.py", line 719, in reraise
raise value
File "D:\Anaconda\anaconda\lib\site-packages\tensorflow\python\training\queue_runner_impl.py", line 257, in _run
enqueue_callable()
File "D:\Anaconda\anaconda\lib\site-packages\tensorflow\python\client\session.py", line 1287, in _single_operation_run
self._call_tf_sessionrun(None, {}, [], target_list, None)
File "D:\Anaconda\anaconda\lib\site-packages\tensorflow\python\client\session.py", line 1441, in _call_tf_sessionrun
return tf_session.TF_SessionRun_wrapper(self._session, options, feed_dict,
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbe in position 90: invalid start byte
个人觉得问题出在下面三段的其中一个,但是吧,可能是我太菜了,看了不少博文也没找到正确的解决方案
I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN)to use the following CPU instructions in performance-critical operations: AVX AVX2
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
W tensorflow/core/framework/op_kernel.cc:1767] OP_REQUIRES failed at whole_file_read_ops.cc:116 : Unknown: NewRandomAccessFile failed to Create/Open: D:/PyCharm/create/try/catdog/data/train/cats : �ܾ����ʡ�
; Input/output error
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbe in position 90: invalid start byte
如果通过ananconda使用jupyter的话也有类似的问题
WARNING:tensorflow:From D:\Anaconda\anaconda\lib\site-packages\tensorflow\python\compat\v2_compat.py:96: disable_resource_variables (from tensorflow.python.ops.variable_scope) is deprecated and will be removed in a future version.
Instructions for updating:
non-resource variables are not supported in the long term