FileNotFoundError: [Errno 2]

Hello,

i have the following issue:

“FileNotFoundError: [Errno 2] No such file or directory: ‘~/.fastai/data/imdb_tok/counter.pkl’”

With the " positive or negative sentiment sentece" from the first notebook of the course.

i appreciate any help to fix it.
Thanks

Hi @fsalmon,
On what machine are you running your code ? Are you running locally ? Also, what versions of Pytorch and Fastai do you have installed ?

Best,

Charles

Hi @nn.Charles
I’m running the code on my macbook pro and the version of Pytorch and Fastai are the lasted
Thanks,
Fransciso

Hi @fsalmon, are you referring to this notebook 01_intro.ipynb?

Looks like you don’t have the counter.pkl file on your local machine. Did you run the initializing code bit at the top of the Colab notebooks that are linked in the course?

!pip install -Uqq fastbook
import fastbook
fastbook.setup_book()

from fastbook import *

They might be downloading some of these datasets for you so that you have access to them.

Two things you could try to isolate the problem more:

  • Run it in the Colab Notebook I linked above. See whether everything works as expected there
  • Search for the dataset and open the downloaded .pkl file instead as your input

Hope that helps!

1 Like

I run that code all the time as I try to get the code to run locally in Visual Studio Code and counter.pkl is missing. fastbook.setup_book is not adding it?

The imdb.tgz doesn’t have the imdb_tok directory in it. This makes me think that the code may be saving the pickle file somewhere else?

1 Like