AttributeError: module ‘numpy’ has no attribute ‘int’
- 原因:yolov5版本的更新
- 解决方案:
- 根据报错信息点进文件中,将看到的np.int改成np.int_,要运行个两三次才能改完(运行一次点进去看到np_int就改),要改好几个地方
- 全部修改完毕会显示
RuntimeError: result type Float can’t be cast to the desired output type __int64,
这个时候要到根据提示点进utils下面的loss.py
将loss.py的167行中
python gain = torch.ones(7, device=targets.device)
改成
python gain = torch.ones(7, device=targets.device).long()