WongKinYiu / ScaledYOLOv4

Scaled-YOLOv4: Scaling Cross Stage Partial Network
GNU General Public License v3.0
2.02k stars 572 forks source link

yolov4-csp.weights load error #19

Open winterxx opened 3 years ago

winterxx commented 3 years ago

Namespace(agnostic_nms=False, augment=False, cfg='models/yolov4-csp.cfg', classes=None, conf_thres=0.4, device='0', img_size=640, iou_thres=0.5, names='data/coco.names', output='inference/output', save_txt=False, source='inference/images', update=False, view_img=False, weights='weights/yolov4-csp.weights') Using CUDA device0 _CudaDeviceProperties(name='GeForce GTX 1080 Ti', total_memory=11175MB)

Model Summary: 342 layers, 5.29214e+07 parameters, 5.29214e+07 gradients Traceback (most recent call last): File "/media/data1/project/project2020/Detection/yolov4/ScaledYOLOv4/yolov4-csp/detect.py", line 187, in detect() File "/media/data1/project/project2020/Detection/yolov4/ScaledYOLOv4/yolov4-csp/detect.py", line 44, in detect model.load_state_dict(torch.load(weights[0], map_location=device)['model']) File "/media/data1/3rdtool/anaconda3/envs/yolov4last/lib/python3.8/site-packages/torch/serialization.py", line 581, in load with _open_file_like(f, 'rb') as opened_file: File "/media/data1/3rdtool/anaconda3/envs/yolov4last/lib/python3.8/site-packages/torch/serialization.py", line 230, in _open_file_like return _open_file(name_or_buffer, mode) File "/media/data1/3rdtool/anaconda3/envs/yolov4last/lib/python3.8/site-packages/torch/serialization.py", line 211, in init super(_open_file, self).init(open(name, mode)) FileNotFoundError: [Errno 2] No such file or directory: 'w'

Process finished with exit code 1

WongKinYiu commented 3 years ago

detect.py is updated, you could try again.

winterxx commented 3 years ago

detect.py line 48: load_darknet_weights(model, weights[0]) ------>modified load_darknet_weights(model, weights) is ok

WongKinYiu commented 3 years ago

yes.