yolov5训练时报错AttributeError: module ‘numpy‘ has no attribute ‘int‘
·
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()
AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。
更多推荐



所有评论(0)