当前位置: 代码迷 >> 综合 >> AttributeError: ‘NoneType‘ object has no attribute ‘_free_weak_ref‘
  详细解决方案

AttributeError: ‘NoneType‘ object has no attribute ‘_free_weak_ref‘

热度:55   发布时间:2023-12-04 13:32:08.0

我在跑YOLOv5的代码时出现以上问题。

原因:

` 这是pytorch版本问题,如果你pytorch是比较高的版本,那么需要降低版本。

解决方法

可以使用以下命令:

pip install torch==1.10.0+cu113 torchvision==0.11.1+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html  -i https://pypi.tuna.tsinghua.edu.cn/simple
  相关解决方案