在b站找了别人分享的代码,想复现一下代码,复现的原代码是tensorflow1.0的版本,我是2.0的
主要用的pycharm,但如果知道jupyter怎么解决,也请不吝赐教!我也可转jupyter
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
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
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
你好,我是有问必答小助手,非常抱歉,本次您提出的有问必答问题,技术专家团超时未为您做出解答
本次提问扣除的有问必答次数,将会以问答VIP体验卡(1次有问必答机会、商城购买实体图书享受95折优惠)的形式为您补发到账户。
因为有问必答VIP体验卡有效期仅有1天,您在需要使用的时候【私信】联系我,我会为您补发。
针对第一个疑似问题添加了
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
然后第一个疑似问题和第二个疑似问题都消失了
但是下面这个还在
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbe in position 90: invalid start byte