I am getting an error when working through the Lesson 4 IMDB code for the first time.
After building the ModelData object for the first time, the next line is
pickle.dump(TEXT, open(f’{PATH}models/TEXT.pkl’,‘wb’))
I am getting the error below. Apologize in advance if covered elsewhere. Thanks for the help!
Sorry for delay in posting solution, as I had forgotten exactly what I did. In this, the answer was pretty simple, I didn’t have a models directory built. I would add that in the data/aclImdb/ folder and it should work. I don’t recall the issue being bigger than this.
Thank you for posting this! It is good to know that you have to add the “model” directory to the “aclimdb” data folder for the application to save its work!
I have been getting different errors running learner.fit on the aclimdb dataset. Wherever I have not run learner.fit I see the following:
Widget Javascript not detected. It may not be installed or enabled properly.
And when I run learner.fit it appears to run, though the output is not very pretty. Basically it tells me:
…/courses/dl1/fastai/model.py:62: UserWarning: torch.nn.utils.clip_grad_norm is now deprecated in favor of torch.nn.utils.clip_grad_norm_.
if IS_TORCH_04: nn.utils.clip_grad_norm(trainable_params_(self.m), self.clip)
Did you create models directory under /fastai/courses/dl1/data/aclImdb/ ?
It seems that the command pickle.dump(TEXT, open(f'{PATH}models/TEXT.pkl','wb')) does not automatically create the directory specified in open() like @sammy500 mentioned.