出现错误 'NoneType' object has no attribute 'seek'

Traceback (most recent call last):
  File "E:\Anaconda3\envs\pipei\lib\site-packages\torch\serialization.py", line 308, in _check_seekable
    f.seek(f.tell())
AttributeError: 'NoneType' object has no attribute 'seek'

文中对应代码:

try:
    f.seek(f.tell())
    return True
except (io.UnsupportedOperation, AttributeError) as e:
    raise_err_msg(["seek", "tell"], e)
return False

 

 

请问解决了吗?能告知一下吗?

你前面的方法呢,seek这个func有定义吗

请问解决了吗 我也是这个问题

您好,我是有问必答小助手,您的问题已经有小伙伴解答了,您看下是否解决,可以追评进行沟通哦~

如果有您比较满意的答案 / 帮您提供解决思路的答案,可以点击【采纳】按钮,给回答的小伙伴一些鼓励哦~~

ps: 问答会员年卡【8折】购 ,限时加赠IT实体书,即可 享受50次 有问必答服务,了解详情>>>https://t.csdnimg.cn/RW5m