YOLOv4-pytorch icon indicating copy to clipboard operation
YOLOv4-pytorch copied to clipboard

CUDA_VISIBLE_DEVICES=0 python3 eval_voc.py --weight_path weight/best.pt --gpu_id 0 --eval --mode det

Open lilangyi opened this issue 4 years ago • 10 comments

在进行detect的时候执行CUDA_VISIBLE_DEVICES=0 python3 eval_voc.py --weight_path weight/best.pt --gpu_id 0 --eval --mode det

保错如下: Traceback (most recent call last): File "eval_voc.py", line 150, in visiual=opt.visiual, File "eval_voc.py", line 79, in detection bboxes_prd = self.__evalter.get_bbox(img, v) File "/home/lee/Desktop/myfiles/20-12-21-pytorch-yolov4/YOLOv4-PyTorch/eval/evaluator.py", line 99, in get_bbox self.__predict(img, test_input_size, valid_scale) File "/home/lee/Desktop/myfiles/20-12-21-pytorch-yolov4/YOLOv4-PyTorch/eval/evaluator.py", line 126, in __predict _, p_d, beta = self.model(img) ValueError: not enough values to unpack (expected 3, got 2)

该如何解决呢

lilangyi avatar Jan 07 '21 16:01 lilangyi

eval_voc.py文件第59行 self.__model, showatt=False.改为self.__model, showatt=True

li-yan-type avatar Jan 08 '21 00:01 li-yan-type

If you update to the latest version you should see the attention block. And you can set showatt to True. Otherwise, I would suggest that you abandon the attention part.

jingtianyilong avatar Jan 08 '21 02:01 jingtianyilong

If you update to the latest version you should see the attention block. And you can set showatt to True. Otherwise, I would suggest that you abandon the attention part.

感谢

lilangyi avatar Jan 08 '21 07:01 lilangyi

eval_voc.py文件第59行 self.__model, showatt=False.改为self.__model, showatt=True

感谢

lilangyi avatar Jan 08 '21 07:01 lilangyi

Traceback (most recent call last): File "C:/Users/gja/Downloads/YOLOv4-pytorch-master/YOLOv4-pytorch-master/eval_voc.py", line 148, in mode=opt.mode File "C:/Users/gja/Downloads/YOLOv4-pytorch-master/YOLOv4-pytorch-master/eval_voc.py", line 38, in init self.__load_model_weights(weight_path) File "C:/Users/gja/Downloads/YOLOv4-pytorch-master/YOLOv4-pytorch-master/eval_voc.py", line 47, in __load_model_weights self.__model.load_state_dict(chkpt["model"]) KeyError: 'model' 该如何解决

gja-bit avatar Jan 15 '21 06:01 gja-bit

Traceback (most recent call last): File "C:/Users/gja/Downloads/YOLOv4-pytorch-master/YOLOv4-pytorch-master/eval_voc.py", line 148, in mode=opt.mode File "C:/Users/gja/Downloads/YOLOv4-pytorch-master/YOLOv4-pytorch-master/eval_voc.py", line 38, in init self.__load_model_weights(weight_path) File "C:/Users/gja/Downloads/YOLOv4-pytorch-master/YOLOv4-pytorch-master/eval_voc.py", line 47, in __load_model_weights self.__model.load_state_dict(chkpt["model"]) KeyError: 'model' 该如何解决

当你使用可视化时,需要重新训练你的的预训练模型

li-yan-type avatar Jan 15 '21 07:01 li-yan-type

Traceback (most recent call last): File "C:/Users/gja/Downloads/YOLOv4-pytorch-master/YOLOv4-pytorch-master/eval_voc.py", line 148, in mode=opt.mode File "C:/Users/gja/Downloads/YOLOv4-pytorch-master/YOLOv4-pytorch-master/eval_voc.py", line 38, in init self.__load_model_weights(weight_path) File "C:/Users/gja/Downloads/YOLOv4-pytorch-master/YOLOv4-pytorch-master/eval_voc.py", line 47, in __load_model_weights self.__model.load_state_dict(chkpt["model"]) KeyError: 'model' 该如何解决

好兄弟你这个问题怎么解决的?我也遇到同样的问题了

minuet-red avatar Feb 10 '21 09:02 minuet-red

追溯(最近一次通话): 文件“ C:/Users/gja/Downloads/YOLOv4-pytorch-master/YOLOv4-pytorch-master/eval_voc.py”,行148,在 mode = opt.mode 文件中,“ C:/用户/gja/Downloads/YOLOv4-pytorch-master/YOLOv4-pytorch-master/eval_voc.py”,第38行,位于初始化 自我中。load_model_weights(weight_path) 文件“ C:/ Users / gja / Downloads / YOLOv4-pytorch-master” /YOLOv4-pytorch-master/eval_voc.py“,第47行,位于__load_model_weights self . model.load_state_dict(chkpt [” model“]) KeyError:'model' 该如何解决

好兄弟你这个问题怎么解决的?我也遇到同样的问题了 self .__ model.load_state_dict(chkpt [” model“])修改为:self .__ model.load_state_dict(chkpt)

lilangyi avatar Feb 12 '21 19:02 lilangyi

追溯(最近一次通话): 文件“ C:/Users/gja/Downloads/YOLOv4-pytorch-master/YOLOv4-pytorch-master/eval_voc.py”,行148,在 mode = opt.mode 文件中,“ C:/用户/gja/Downloads/YOLOv4-pytorch-master/YOLOv4-pytorch-master/eval_voc.py”,第38行,位于初始化 自我中。load_model_weights(weight_path) 文件“ C:/ Users / gja / Downloads / YOLOv4-pytorch-master” /YOLOv4-pytorch-master/eval_voc.py“,第47行,位于__load_model_weights self . model.load_state_dict(chkpt [” model“]) KeyError:'model' 该如何解决

好兄弟你这个问题怎么解决的?我也遇到同样的问题了 self .__ model.load_state_dict(chkpt [” model“])修改为:self .__ model.load_state_dict(chkpt)

感谢

minuet-red avatar Feb 13 '21 06:02 minuet-red

Traceback (most recent call last): File "C:/Users/gja/Downloads/YOLOv4-pytorch-master/YOLOv4-pytorch-master/eval_voc.py", line 148, in mode=opt.mode File "C:/Users/gja/Downloads/YOLOv4-pytorch-master/YOLOv4-pytorch-master/eval_voc.py", line 38, in init self.__load_model_weights(weight_path) File "C:/Users/gja/Downloads/YOLOv4-pytorch-master/YOLOv4-pytorch-master/eval_voc.py", line 47, in __load_model_weights self.__model.load_state_dict(chkpt["model"]) KeyError: 'model' 该如何解决

当你使用可视化时,需要重新训练你的的预训练模型

直接用题主训练好的模型,没办法直接显示注意力的热力图吗?

inuxer avatar Mar 08 '22 09:03 inuxer