报错汇总及解决(以后慢慢加)

pytorch yolo4 感谢博主https://blog.csdn.net/weixin_44791964/article/details/106214657

ModuleNotFoundError: No module named ‘cv2’

 pip install -i https://pypi.tuna.tsinghua.edu.cn/simple opencv-python

Traceback (most recent call last):
File “/home/pc001/e/gcgnew/yolov4-pytorch-master/nets/yolo_training.py”, line 8, in
from matplotlib.colors import rgb_to_hsv, hsv_to_rgb
ModuleNotFoundError: No module named ‘matplotlib’

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple matplotlib  

Traceback (most recent call last):
File “/home/pc001/e/gcgnew/yolov4-pytorch-master/get_dr_txt.py”, line 18, in
from tqdm import tqdm
ModuleNotFoundError: No module named ‘tqdm’

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tqdm

Traceback (most recent call last):
File “/home/pc001/e/gcgnew/yolov4-pytorch-master/get_dr_txt.py”, line 75, in
yolo = mAP_Yolo()
File “/home/pc001/e/gcgnew/yolov4-pytorch-master/yolo.py”, line 45, in init
self.generate()
File “/home/pc001/e/gcgnew/yolov4-pytorch-master/yolo.py”, line 76, in generate
state_dict = torch.load(self.model_path, map_location=device)
File “/home/pc001/anaconda3/envs/yolo4pytorch/lib/python3.6/site-packages/torch/serialization.py”, line 381, in load
f = open(f, ‘rb’)
FileNotFoundError: [Errno 2] No such file or directory: ‘model_data/yolo4_weights.pth’

没有对应的权重文件

Traceback (most recent call last):
File “/home/pc001/e/gcgnew/yolov4-pytorch-master/VOCdevkit/VOC2007/voc2yolo4.py”, line 11, in
temp_xml = os.listdir(xmlfilepath)
FileNotFoundError: [Errno 2] No such file or directory: ‘./VOCdevkit/VOC2007/Annotations’

xmlfilepath=r'./VOCdevkit/VOC2007/Annotations'
saveBasePath=r"./VOCdevkit/VOC2007/ImageSets/Main/"
print(xmlfilepath)

print 的路径不正确
解决方式:1 改为绝对路径

xmlfilepath=r'/home/pc001/e/gcgnew/yolov4-pytorch-master/VOCdevkit/VOC2007/Annotations'
saveBasePath=r"/home/pc001/e/gcgnew/yolov4-pytorch-master/VOCdevkit/VOC2007/ImageSets/Main/"

2

ROOT_DIR = os.getcwd()


xmlfilepath=os.path.join(ROOT_DIR, r"Annotations/")
saveBasePath=os.path.join(ROOT_DIR,r"ImageSets/Main/")
# xmlfilepath=r'./VOCdevkit/VOC2007/Annotations'
# saveBasePath=r"./VOCdevkit/VOC2007/ImageSets/Main/"
  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值