Model is saved with torch.save(model.state_dict()).
When I switch to python 2.7 and use
checkpoint = torch.load(Path(model_dir)) model.load_state_dict(checkpoint)
It gives the following error
AttributeError: 'PosixPath' 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.
Is there a way to avoid this?