Open zzk999 opened 3 years ago
demo.py line 55 replace to:"checkpoint = torch.load(opt.weights[0], map_location= device)", "opt.weights" is a list, but here need a weight path(str).
thank you!!
Hi leidi1989, after I changed checkpoint_file = args.weights[0]
in test.py, it raised me another error as shown above, any clues? Thanks in advance!
checkpoint_file is a list, so you have to replace the 86th line in test.py to checkpoint = torch.load(checkpoint_file[0])
my python version is 3.8, and when run python tools/test.py the question arised, can you help me? thank you!
File "tools/test.py", line 153, in
main()
File "tools/test.py", line 86, in main
checkpoint = torch.load(checkpoint_file)
File "/home/kasm-user/anaconda3/envs/torch19/lib/python3.8/site-packages/torch/serialization.py", line 594, in load
with _open_file_like(f, 'rb') as opened_file:
File "/home/kasm-user/anaconda3/envs/torch19/lib/python3.8/site-packages/torch/serialization.py", line 235, in _open_file_like
return _open_buffer_reader(name_or_buffer)
File "/home/kasm-user/anaconda3/envs/torch19/lib/python3.8/site-packages/torch/serialization.py", line 220, in init
_check_seekable(buffer)
File "/home/kasm-user/anaconda3/envs/torch19/lib/python3.8/site-packages/torch/serialization.py", line 311, in _check_seekable
raise_err_msg(["seek", "tell"], e)
File "/home/kasm-user/anaconda3/envs/torch19/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.