Open jackydinosaur opened 3 years ago
File "test.py", line 67, in test ckpt = torch.load(weights, map_location=device) # load checkpoint
try to change this line to: ckpt = torch.load(weights[0], map_location=device) # load checkpoint
Thanks a lot! File "test.py", line 67,71 in test, I change 「weights」to「weights[0]」. However, another error occurred.
Using torch 1.7.1 CUDA:0 (GeForce GTX 1080 Ti, 11177MB)
I checked 「nc:80」 in coco.yaml and「classes=80」inyolov4-csp-cfg. Changing numpy version=1.17 didn't work.
how might able to solve it?
Thanks a lot.
File "test.py", line 260, in test anno_json = glob.glob('../coco/annotations/instances_val*.json')[0] # annotations json
try to change this line to: anno_json = glob.glob('./coco/annotations/instances_val*.json')[0] # annotations json
It works! I truly appreciate your help very much. It's important for me to learning.
Hello Wong, When I running detect.py some errors occurred.
1.command:python detect.py --weights weights/yolov4-csp.weights --source inference/images/000001.jpg --cfg models/yolov4-csp.cfg
how might able to solve it?
I am looking forward to your reply.
i fixed detect.py, just update your detect.py.
It works! Thanks a lot!
Hi, thanks for the great work!!
The testing command is :python test.py --img 640 --conf 0.001 --iou 0.65 --batch 8 --device 0 --data coco.yaml --cfg models/yolov4-csp.cfg --weights weights/yolov4-csp.weights
3 errors occurred.
I run this code on Windows 10 and Ubuntu 18.04, the same errors occurred.
Using torch 1.7.1 CUDA:0 (GeForce GTX 1080 Ti, 11177MB)
Model Summary: 516 layers, 52921437 parameters, 52921437 gradients Traceback (most recent call last): File "/opt/miniconda/envs/yolov4/lib/python3.8/site-packages/torch/serialization.py", line 308, in _check_seekable f.seek(f.tell()) AttributeError: 'list' object has no attribute 'seek'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "test.py", line 67, in test ckpt = torch.load(weights, map_location=device) # load checkpoint File "/opt/miniconda/envs/yolov4/lib/python3.8/site-packages/torch/serializati on.py", line 581, in load with _open_file_like(f, 'rb') as opened_file: File "/opt/miniconda/envs/yolov4/lib/python3.8/site-packages/torch/serialization.py", line 235, in _open_file_like return _open_buffer_reader(name_or_buffer) File "/opt/miniconda/envs/yolov4/lib/python3.8/site-packages/torch/serializaton.py", line 220, in init _check_seekable(buffer) File "/opt/miniconda/envs/yolov4/lib/python3.8/site-packages/torch/serialization.py", line 311, in _check_seekable raise_err_msg(["seek", "tell"], e) File "/opt/miniconda/envs/yolov4/lib/python3.8/site-packages/torch/serialization.py", line 304, in raise_err_msg raise type(e)(msg) AttributeError: 'list' object has no attribute 'seek'. You can only torch.load from a file that is seekable. Please pre-load the data into a buffer like io.BytesIO and try to load from it instead.
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "test.py", line 319, in
test(opt.data,
File "test.py", line 71, in test
load_darknet_weights(model, weights)
File "/Data/jackydinosaur/Yolov4/YOLOv4-CSP/models/models.py", line 575, in load_darknet_weights
file = Path(weights).name
File "/opt/miniconda/envs/yolov4/lib/python3.8/pathlib.py", line 1042, in new
self = cls._from_parts(args, init=False)
File "/opt/miniconda/envs/yolov4/lib/python3.8/pathlib.py", line 683, in _from_parts
drv, root, parts = self._parse_args(args)
File "/opt/miniconda/envs/yolov4/lib/python3.8/pathlib.py", line 667, in _parse_args
a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not list
how might able to solve it?
Thanks a lot.