刘不住头发 2022-01-05 00:13 采纳率: 100%
浏览 339
已结题

猫狗识别问题一 python+tensorflow+pycharm(也可anaconda)

开心按下小绿键,哭着面对一片红

猫狗识别

在b站找了别人分享的代码,想复现一下代码,复现的原代码是tensorflow1.0的版本,我是2.0的
主要用的pycharm,但如果知道jupyter怎么解决,也请不吝赐教!我也可转jupyter

程序已经加了

import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()

兴高采烈地按了小绿键,结果出现一片红,我人傻了

loss和accuracy的图也出不来

img

那片红海就是下面这串

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

img

个人觉得问题出在下面三段的其中一个,但是吧,可能是我太菜了,看了不少博文也没找到正确的解决方案
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

好家伙,直接连空白的绘图都没有了
但是我觉得它的warning看起来好像只是版本的问题,当然,只是我觉得

img

问题图里的那个空白的绘图应该是长这个样子的

img

哭了,搞了几天,下了很多写好的代码,没有一个可以复现的,很喜欢这个程序的风格,不想再换人换代码了
如果知道怎么解决这片红海,把训练图(准确率与损失值)给复现出来,请不吝赐教!
  • 写回答

3条回答 默认 最新

  • 有问必答小助手 2022-01-06 10:09
    关注

    你好,我是有问必答小助手,非常抱歉,本次您提出的有问必答问题,技术专家团超时未为您做出解答


    本次提问扣除的有问必答次数,将会以问答VIP体验卡(1次有问必答机会、商城购买实体图书享受95折优惠)的形式为您补发到账户。


    因为有问必答VIP体验卡有效期仅有1天,您在需要使用的时候【私信】联系我,我会为您补发。

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

问题事件

  • 系统已结题 1月14日
  • 已采纳回答 1月6日
  • 创建了问题 1月5日

悬赏问题

  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效