yolact icon indicating copy to clipboard operation
yolact copied to clipboard

TypeError: ord() expected a character, but string of length 0 found

Open sameer56 opened this issue 4 years ago • 2 comments

Traceback (most recent call last): File "/usr/lib/python3.5/tarfile.py", line 2279, in next tarinfo = self.tarinfo.fromtarfile(self) File "/usr/lib/python3.5/tarfile.py", line 1083, in fromtarfile obj = cls.frombuf(buf, tarfile.encoding, tarfile.errors) File "/usr/lib/python3.5/tarfile.py", line 1019, in frombuf raise EmptyHeaderError("empty header") tarfile.EmptyHeaderError: empty header

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/teai/pramod/new/act_env/lib/python3.5/site-packages/torch/serialization.py", line 595, in _load return legacy_load(f) File "/home/teai/pramod/new/act_env/lib/python3.5/site-packages/torch/serialization.py", line 506, in legacy_load with closing(tarfile.open(fileobj=f, mode='r:', format=tarfile.PAX_FORMAT)) as tar,
File "/usr/lib/python3.5/tarfile.py", line 1575, in open return func(name, filemode, fileobj, **kwargs) File "/usr/lib/python3.5/tarfile.py", line 1605, in taropen return cls(name, mode, fileobj, **kwargs) File "/usr/lib/python3.5/tarfile.py", line 1470, in init self.firstmember = self.next() File "/usr/lib/python3.5/tarfile.py", line 2294, in next raise ReadError("empty file") tarfile.ReadError: empty file

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "train.py", line 387, in train() File "train.py", line 163, in train yolact_net.load_weights(args.resume) File "/home/teai/pramod/new/yolact/yolact.py", line 467, in load_weights state_dict = torch.load(path) File "/home/teai/pramod/new/act_env/lib/python3.5/site-packages/torch/serialization.py", line 426, in load return _load(f, map_location, pickle_module, **pickle_load_args) File "/home/teai/pramod/new/act_env/lib/python3.5/site-packages/torch/serialization.py", line 597, in _load if _is_zipfile(f): File "/home/teai/pramod/new/act_env/lib/python3.5/site-packages/torch/serialization.py", line 75, in _is_zipfile if ord(magic_byte) != ord(read_byte): TypeError: ord() expected a character, but string of length 0 found

sameer56 avatar Oct 31 '19 14:10 sameer56

Looks like whatever weights file you tried to load there was corrupt. Can you elaborate on what you were trying to do?

dbolya avatar Oct 31 '19 20:10 dbolya

Do you fix it?I have same problem in another project.Don't know why.Someone answer that it's a problem about data size.I don't know it will help you or not.

LeesCode avatar Feb 10 '22 04:02 LeesCode