AttributeError: 'torch._C.PyTorchFileReader' object has no attribute 'seek'

I tried to load the parameters of the model, but reported this error


from naie.datasets import get_data_reference
import torch
import torchvision.models as models
from utils import EarlyStopping
if __name__ == "__main__":



Traceback (most recent call last):
  File "", line 11, in <module>
  File "/home/work/anaconda/lib/python3.6/site-packages/torch/", line 584, in load
    return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
  File "/home/work/anaconda/lib/python3.6/site-packages/moxing/framework/file/", line 200, in _load
  File "/home/work/anaconda/lib/python3.6/site-packages/torch/", line 309, in _check_seekable
    raise_err_msg(["seek", "tell"], e)
  File "/home/work/anaconda/lib/python3.6/site-packages/torch/", line 302, in raise_err_msg
    raise type(e)(msg)
AttributeError: 'torch._C.PyTorchFileReader' 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.

my pytorch version is 1.6

I cannot reproduce this issue using the provided code snippet and am not sure what might cause this error.
Are you also using torchvision==0.7?

Same here, my pytorch is alos 1.6. I also used AMP library.
I have been working with this code for so long. With pytorch 1.3 I never faced this problem.

torchvision.version = 0.7.0
torch.version= 1.6.0
cu 10.2

I have the same problem. The same code works on local but does not work on company cloud. Did anybody find a solution?