I got a model trained with PyTorch 1.4. If I script and save this model with PyTorch 1.4, it will save successfully, but I need to script and save this model with PyTorch 1.3. When I save model with 1.3, I got error message:
RuntimeError: Unknown IValue type for pickling: Device (pushIValueImpl at /pytorch/torch/csrc/jit/pickler.cpp:125)
It implies that somewhere in your model, you’re storing a device type and trying to serialize it (like self.foo = my_device). This is supported in 1.4 but not 1.3; if you want your model to work with 1.3, you’ll have to avoid storing references to devices.