Lesson 01 Intro Text Classifier Training Error

Here’s the code and error:

I just started today and have no clue how to fix this. I’m having a lot of issues with the notebook. I had to add “num_workers” as wel as “bs” to a couple of the cells. Any ideas on how to fix this cell?


Installed Spacy 2.2.4 b/c saw that that fixed the issue for someone. Now facing this problem:

Changed the code. Stuck training. Any ideas?

finished. Now this error:

changed my code to this and the previous error went away. Now this:

Hi spikeytwo hope all is well!

One of the quickest ways to get started is to use the links below.

If you look at the first element in the above notebook you can see we use the fastbook module.

I can confirm this notebook works end to end though in cell 9 you have to upload a cat image.

Hope this helps mrfabulous1 :smiley: :smiley:

Hello @mrfabulous1 thank you for your working code. Do the remainder of the notebooks in this course have issues like this(either in jupyter or colab) or should they also work?

Hi spikeytwo

When I ran the first seven notebooks on colab they all ran ok.

I have’nt run them in plain Jupyter as I currently don’t have a machine with a powerful enough GPU.

The code is continuosly changing so if you are running them on a pc with jupyter notebook you have to make sure you use a virtual environment and record the library versions in anaconda and or use pip freeze to make sure none of the libraries have changed.

Each lesson has an official thread, this can help solve errors related to any of the lesson notebooks.


Unril one becomes familar with fastai, I would use the notebooks links in my previous post and ammend them to your own needs, this will help reduce problems and errors.

Cheers mrfabulous1 :smiley: :smiley:

@mrfabulous1 Thanks again. I just started using the colab scripts you gave me instead of messing with jupyter. Is it common for the sample models to take upwards of 20/30 minutes to train?

You should ensure the GPU is enabled by checking Runtime -> Change Runtime Version -> GPU

GPU is enabled. However, according to my task manager, it doesn’t look like colab is using it.

You won’t see it in task manager, google colab runs on a GPU in the cloud. Depending on the model, GPU, and dataset, text models can take 10-20 minutes per epoch (ex IMDB dataset),

Does torch.cuda.is_available() return True?

Ahh, so it’s not my local gpu. Got it, text models take 10/20 min per epoch for imdb. my model is still training, but I’ll check the cuda available right after it finishes.

Returned true @muellerzr