Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在使用训练过的模型进行测试时遇到问题RuntimeError: storage has wrong size #14

Open
bestFannie opened this issue May 14, 2022 · 0 comments

Comments

@bestFannie
Copy link

bestFannie commented May 14, 2022

你好,感谢开源!但是我在测试训练的模型时遇到了以下问题,请问是哪里出问题了呢?

model_type: bert-pho2-res-arch3
weight_dir: output
ckpt_name: saved_ckpt-11000
100%|████████████████████████████████████████████████████████████████| 35/35 [00:03<00:00, 10.99it/s]
test_batches: 35
Load model begin...
Traceback (most recent call last):
  File "src/test.py", line 180, in <module>
    device=args.device,
  File "src/test.py", line 126, in test
    model = model_class.from_pretrained(model_dir)
  File "/home/ReaLiSe/ReaLiSe-master/transformers/modeling_utils.py", line 409, in from_pretrained
    state_dict = torch.load(resolved_archive_file, map_location='cpu')
  File "/root/miniconda3/envs/f36/lib/python3.6/site-packages/torch/serialization.py", line 386, in load
    return _load(f, map_location, pickle_module, **pickle_load_args)
  File "/root/miniconda3/envs/f36/lib/python3.6/site-packages/torch/serialization.py", line 580, in _load
    deserialized_objects[key]._set_from_file(f, offset, f_should_read_directly)
RuntimeError: storage has wrong size: expected -4698162557506238965 got 2359296
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant