Lesson 4 Error

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!

FileNotFoundError Traceback (most recent call last)
----> 1 pickle.dump(TEXT, open(f’{PATH}models/TEXT.pkl’,‘wb’))

FileNotFoundError: [Errno 2] No such file or directory: ‘data/imdb/aclImdb/models/TEXT.pkl’

Problem fixed, thanks!

Write how you fixed your problem, so in the future when people search for the same thing they know how to fix it.

Hey @sammy500 mind sharing how you fixed the problem?

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.

1 Like

Yep I think I did the same - got confusing since I was upgrading and downgrading spacy 2.xx < > 1.9.0 to get it to work.

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)

Screenshot attached.

1 Like

I’m having the same bug. Did you found how to stop that. This is worrying.

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.

hey every one i am getting the following error can anyone help me out …
please …

i am getting the brokenprocesspool could anyone suggest me how can it be solved…

i have tries all the possibilites liek num_workers =1 but it is giving me the same…