Issue
drzamoramora opened this issue · 1 comments
drzamoramora commented
Hi,
I downloaded the code and ran:
python detect.py --source ./inference/videos/video.mp4
the got the following error:
Namespace(agnostic_nms=False, augment=False, classes=None, conf_thres=0.4, device='', fourcc='mp4v', img_size=640, iou_thres=0.5, output='inference/output', save_txt=False, source='./inference/videos/video.mp4', view_img=False, weights='weights/yolov5s.pt')
Using CUDA device0 _CudaDeviceProperties(name='GeForce RTX 2070 SUPER', total_memory=8192MB)
Traceback (most recent call last):
File "C:\Users\XPC\anaconda3\envs\py36\lib\tarfile.py", line 189, in nti
n = int(s.strip() or "0", 8)
ValueError: invalid literal for int() with base 8: 'py\nndarr'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\XPC\anaconda3\envs\py36\lib\tarfile.py", line 2297, in next
tarinfo = self.tarinfo.fromtarfile(self)
File "C:\Users\XPC\anaconda3\envs\py36\lib\tarfile.py", line 1093, in fromtarfile
obj = cls.frombuf(buf, tarfile.encoding, tarfile.errors)
File "C:\Users\XPC\anaconda3\envs\py36\lib\tarfile.py", line 1035, in frombuf
chksum = nti(buf[148:156])
File "C:\Users\XPC\anaconda3\envs\py36\lib\tarfile.py", line 191, in nti
raise InvalidHeaderError("invalid header")
tarfile.InvalidHeaderError: invalid header
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\XPC\anaconda3\envs\py36\lib\site-packages\torch\serialization.py", line 555, in _load
return legacy_load(f)
File "C:\Users\XPC\anaconda3\envs\py36\lib\site-packages\torch\serialization.py", line 466, in legacy_load
with closing(tarfile.open(fileobj=f, mode='r:', format=tarfile.PAX_FORMAT)) as tar, \
File "C:\Users\XPC\anaconda3\envs\py36\lib\tarfile.py", line 1589, in open
return func(name, filemode, fileobj, **kwargs)
File "C:\Users\XPC\anaconda3\envs\py36\lib\tarfile.py", line 1619, in taropen
return cls(name, mode, fileobj, **kwargs)
File "C:\Users\XPC\anaconda3\envs\py36\lib\tarfile.py", line 1482, in __init__
self.firstmember = self.next()
File "C:\Users\XPC\anaconda3\envs\py36\lib\tarfile.py", line 2309, in next
raise ReadError(str(e))
tarfile.ReadError: invalid header
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "detect.py", line 166, in <module>
detect()
File "detect.py", line 21, in detect
model = torch.load(weights, map_location=device)['model'].float() # load to FP32
File "C:\Users\XPC\anaconda3\envs\py36\lib\site-packages\torch\serialization.py", line 386, in load
return _load(f, map_location, pickle_module, **pickle_load_args)
File "C:\Users\XPC\anaconda3\envs\py36\lib\site-packages\torch\serialization.py", line 559, in _load
raise RuntimeError("{} is a zip archive (did you mean to use torch.jit.load()?)".format(f.name))
RuntimeError: weights/yolov5s.pt is a zip archive (did you mean to use torch.jit.load()?)
ALl the pt files are in the weights folder.
any clue?
ChargedMonk commented
@cenfotec-ailab, could you copy this notebook and try it. I think there are some issues with the weights on your side. I would appreciate a more detailed explanation of the issue.