Did you store the Trainer instance directly? Also, could you post its definition?
As explained in the serialization docs 2 it’s recommended to store the state_dicts instead of the objects, as changes in the source files might yield to such errors and you would also have to make sure to recreate the same folder structure.