Lesson 1 - Notebook stuck in create_cnn

Ok, kind of weird. With pytorch 1.0.0, I get the BrokenPipeError only when I use Spyder (beta version 4), but it works fine with Jupyter notebook. I’m also using python 3.6, but with Anaconda.

Well, guess I’ll use Jupyter notebook for FastAI for now, though I hope there will be some proper solution / support for the whole thing in future.

Did you check the ram usage, when you got the error? For me it appears that the broken pipe error happens, when my ram runs out of memory.

I’m also stuck in the exact same place.
After running create_cnn everything freezes.
It works on wsl, but of course no GPU support available there.

So disappointing to be right on the edge of being able to play with this and poof it just doesn’t work.

Please try with pytorch 1.0.0, it works in Windows with FastAI

1 Like

(fastai) C:\Users\Q\fastai>conda install pytorch==1.0.0
Collecting package metadata: done
Solving environment: failed

PackagesNotFoundError: The following packages are not available from current channels:

  • pytorch==1.0.0

(fastai) C:\Users\Q\fastai>pip install torch==1.0.0
Collecting torch==1.0.0
Could not find a version that satisfies the requirement torch==1.0.0 (from versions: 0.1.2, 0.1.2.post1)
No matching distribution found for torch==1.0.0

Confirmed working solution

View your current version of cuda with (in a command prompt, cmd, powershell, etc)
nvcc --version

Use the wheel, dont use conda
download this IF you are using cuda 9.0, otherwise you will have to find the link on your own
https://download.pytorch.org/whl/cu90/torch-1.0.0-cp36-cp36m-win_amd64.whl

Make sure to NOT download pytorch 0.4, but rather pytorch 1.0.0

After you download the correct cuda version pytorch wheel, just install it as a normal pip package
pip install torch-1.0.0-cp36-cp36m-win_amd64.whl

Thanks for sharing - really helped me progress. Fix works fine for me. I’m using pytorch 1.0.0 deployed using conda on Windows 10 / CPU.

Solved using this thread’s advice/information!
Thanks @rohitgeo, @dalohr, @imrandude, @nubonics, @peter_zacho and everyone else for sharing your experiences.

Downgrading from Pytorch 1.0.1 to Pytorch 1.0.0 was my solution/workaround.

My specific situation:
Tried to use conda (I wanted to confirm if using wheel was necessary)

conda install pytorch=1.0.0 torchvision cudatoolkit=10.0 -c pytorch

But it wanted to use Cuda 9, and i didn’t look into specifying that with conda.

The following packages will be DOWNGRADED:
pytorch 1.0.1-py3.7_cuda100_cudnn7_1 --> 1.0.0-py3.7_cuda90_cudnn7_1

So downloaded the .whl i needed. Python 3.7, Cuda 10, Windows 10 from https://pytorch.org/get-started/previous-versions/ and installed with pip.
PS: If you are using a virtual env, don’t forget to activate it before using pip!

Thanks again, I can finally work offline!

Thanks to this thread. I was also facing this issue and fixed by downgrading pytorch to 1.0.0 version.

So is the cause of the freeze due to a bug in PyTorch 1.0.1 or an issue with FastAI that hasn’t adapted to the new PyTorch iteration?

Breaking changes:

  • create_cnn becomes cnn_learner
  • random_split_by_pct becomes split_by_rand_pct
  • no_split becomes split_none
1 Like

Thank’s :pray:

Hi everyone,

I still getting the error when executing this line in lesson 1

learn = cnn_learner(data, models.resnet34, metrics=error_rate)

"NameError Traceback (most recent call last)

<ipython-input-9-efdbe27853be> in <module>() ----> 1 learn = cnn_learner(data, models.resnet34, metrics=error_rate)

NameError: name ‘cnn_learner’ is not defined"

I installed python 1.0.0 as suggested by the forum. Im using jupyter notebooks.
Do you know what it could be the problem?, thanks

Your fastai version may not be the latest… try using create_cnn instead of cnn_learner

This is fixed with v1.0.49 (Major new changes and features)

thanks for your reply. I tried this and didn’t work either

What’s your fastai version?

from fastai import *
print(__version__)

I downloaded the notebook again and start working on it and now is working. Thanks @SBecker @imrandude @ilovescience

Use this instead — { conda install pytorch=1.0.0 -c pytorch }

learn.fit_one_cycle how do I run it on GPU? (cuda available = True)