I am using PyTorch 0.4.
I defined a PyTorch MyModel by inheriting from nn.Module, and saved an instance of it by calling
torch.save(my_model, my_path)
Then, when loading it again with torch.load(my_path), my program crashed with the following error:
AttributeError: 'MyModel' object has no attribute 'to'
But my program was able to run it in previous stages. What did go wrong?