在使用pycharm跑yovol5的里面的简单样例coco128时,几轮都跑完了,但是在跑的过程中,一直在报AttributeError: 'NoneType' object has no attribute '_free_weak_ref'的错误,同时在runs/train/ 里面只有三个exp,每个exp里面有四个,weights,opt,hyp,还有一个名字很长的
我把错误翻了一遍,返现报这个错的都是这两个
再次编辑:
在github上找到了该问题,附上链接
https://github.com/ultralytics/yolov5/issues/6962
?%ra=link
AttributeError: 'NoneType' object has no attribute '_free_weak_ref' 这个报错说明代码中对于这个_free_weak_ref函数的调用错误,正常应该是 实例对象._free_weak_ref(参数) 现实使用出现了实例对象并没有初始化而是一个空值 none._free_weak_ref(参数)
解决了吗,我也遇到了同样的问题啊
我在使用yolov3的时候也遇到了这个问题 不知道怎么解决 不知道楼主有没有找到解决方案
果然不能头脑发热随便更新版本
看完版主给的链接,说是pytorch的版本问题,要在环境内修改,输入一下代码:
pip install --upgrade --force-reinstall torch==1.8.0 torchvision==0.9.0 torchaudio==0.8.0
你先在会调用_free_weak_ref的所有地方加个try,打印一下,看到底是哪里报错,不要靠猜