【发布时间】:2021-06-26 19:46:54
【问题描述】:
我正在尝试实现以下存储库的预训练模型。我需要您的帮助来纠正错误。
RuntimeError: 意外 EOF,预计多 3302200 个字节。文件可能已损坏。
我尝试使用 google Collab 在以下 repo 中实现 CANNet 的预训练模型,并遵循(先决条件、克隆、数据准备和测试)的所有步骤
https://github.com/gjy3035/NWPU-Crowd-Sample-Code.git
下面给出详细错误
Traceback (most recent call last):
File "test.py", line 118, in
main()
File "test.py", line 46, in main
test(lines, model_path)
File "test.py", line 55, in test
net.load_state_dict(torch.load(model_path))
File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 593, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 779, in _legacy_load
deserialized_objects[key]._set_from_file(f, offset, f_should_read_directly)
RuntimeError: unexpected EOF, expected 3302200 more bytes. The file might be corrupted.
【问题讨论】:
标签: pytorch pre-trained-model torchvision