Hello. I’m looking at the server setup at: https://course.fast.ai/start_salamander.html
I’m trying to train a language model on one of the possible servers, save it, download it to my PC, and make inference on my PC.
It doesn’t work well. I’ve tried kaggle, azure, gradient, colab, and I have problems at all of them.
I’ve also looked at this forum post:
But the answer there just says that bugs where fixed and I can’t solve this in the proposed method.
This is my tries:
learn = language_model_learner(wiki_data, AWD_LSTM, drop_mult=0.3)
learn.fit_one_cycle(1, 1e-1, moms=(0.8,0.7))
Saving the data
data_lm.save(‘data_lm’)
Now the tries for saving & loading after reading the docs:
https://docs.fast.ai/basic_train.html
and this tutorial:
https://docs.fast.ai/tutorial.inference.html
learn.export(‘lm.pkl’)
learn.save(‘trained_lm’)
Then on my PC:
data_lm_loaded = load_data(path, ‘data_lm.pkl’)
learn_try_1 = load_learner(path, ‘lm.pkl’)
learn_try_2 = language_model_learner(data_lm_loaded, AWD_LSTM, drop_mult=0.3)
learn_try_2.load(‘trained_lm’)
I’ve also tried save_encoder & load_encoder.
For the first try:
learn_try_1 = load_learner(path, ‘lm.pkl’)
when I do
lm2_loaded.summary()
I get the following error:
Exception: This is an empty
Learner
andLearner.summary
requires some data to pass through the model.
For the second try:
learn_try_2 = language_model_learner(data_lm_loaded, AWD_LSTM, drop_mult=0.3)
learn_try_2.load(‘trained_lm’)
I receive the following error on my PC while trying to load the model (Loading in the Gradient server works fine):
NotImplementedError: cannot instantiate ‘PosixPath’ on your system
This error occured on Colab as well.
In the kaggle I had problems with bad fastai version.
I’m trying to solve it for long time now.
What am I missing?
I’m willing to take any solution as well as other paid services, but till now I’ve tried 4 servers and couldn’t figure it out so I think that i’m doing something with the code.