Unable to create pickle file of model with Transformer

Unable to create pickle file of a model with Transformer+fastai

Need help, please tell us how to save this kind of model? learner.export() is not working its giving following error- PicklingError: Can’t pickle <function at 0x7fdfbffea1e0>: attribute lookup on main failed

I follow this tutorial https://towardsdatascience.com/fastai-with-transformers-bert-roberta-xlnet-xlm-distilbert-4f41ee18ecb2

So, now what should I do?
I trained my model on colab and created the .pth model. It was working properly on it, but when I started working on a local machine It gave me such error-
“BrokenProcessPool: A process in the process pool was terminated abruptly while the future was running or pending.”
This error is occurring when I am trying to create a databunch on a local machine.

Hi dipesh_pal

It sounds like you are trained your model on colab and are now running it locally, this equates to deploying your model in another environment. If there are differences between 1 or more library versions such as pytorch etc on your local environment and colab you will get strange errors.

You might try going to this thread Deployment Platform: Render ✅ and searching for pip list you will find on this thread how many people overcome difficulties deploying their models elsewhere.

I use colab and have found it very reliable if learn.export() is not working then there is probably a problem in your code elsewhere.

Cheers mrfabulous1 :smiley::smiley: