while loading a model trained using python 2 in python 3, i get the error about encoding :
is there any workaround to this ?
it looks like you are saving a string as part of your model. See https://stackoverflow.com/questions/28218466/unpickling-a-python-2-object-with-python-3 for example.
Either dont save strings on your model, or instead of saving and loading the whole model, you can:
model = Model() # construct a new model
See https://github.com/pytorch/examples/tree/master/imagenet for an example.
this worked thank you.