Set up course v3 on Windows

The step 6 instructions at https://course.fast.ai/start_aws.html works for me.

  1. Launch ‘Anaconda Prompt’

  2. Install Git for Windows

  3. To get a folder with all the fast.ai materials:

git clone https://github.com/fastai/course-v3
  1. Then run these commands to install the necessary packages for experimenting with fast.ai and PyTorch:
conda update conda
conda install -c pytorch -c fastai fastai pytorch torchvision cuda92
  1. Next move into the directory where you will find the materials for the course by running:
cd course-v3/nbs/dl1
  1. Finally run:
jupyter notebook
10 Likes

@bsalita Yes, I checked out a new fastai folder which is at the same level of course-v3.

Thanks, @alice.

By following your steps, I am able to elimite the following error:
ModuleNotFoundError: No module named ‘fastai’

But when I run the second cell in lesson1-pets.ipynb:
from fastai.vision import
from fastai.metrics import error_rate

I got the dll load error.
ImportError: DLL load failed: The specified module could not be found.
I am attaching a screen shot below.

Many thanks,

Jack

Hi alice,

Thank you soooo much for mentioning this. I was so confused the last days over getting my own laptop ready for the course and was finally thinking of a Linux installation on it. I’m glad i saw this. Thank you!

3 Likes

@alice Did you set up a fastai enviornment in conda?

OK. Now I know my problem. I have been creating a fastai environment following Howto: installation on Windows . Apparently the enviorment created in the fastai/fastai folder does not work for course v3. This didn’t work even if I do
conda install -c pytorch -c fastai fastai pytorch torchvision cuda92

Now, if I simply do the above installation in the base environment of conda, then it works. It would be nice though if a fastai enviorment can be created for course v3. Maybe it is already existing somewhere but I just don’t know of.

In short, do what @alice mentioned in the base environment in conda. Thanks everyone for helping out!

Jack

1 Like

You can try pinning version of Pytorch to 1.0.0. I noticed some issues with fastai on latest Pytorch 1.0.1 on Windows.

Thanks @zenlytix for the information. I am using Pytorch 1.0.1. What is the problem? How to resolve it?

BTW, for those who wants to check the version of pytouch on terminal, you may simply type
python -c "import torch; print(torch.__version__)"

The problem I noticed was that the create_cnn in lesson1 was hanging indefinitely when I updated Pytorch to 1.0.1. To resolve it I pinned version of Pytorch to 1.0.0 by running : conda install -c pytorch pytorch=1.0.0. You can use this script that is used on Azure Windows Data Science VM as a reference.

@zenlytix I confirmed that Pytorch 1.0.1 does have problem. Switching back to 1.0.0 helps. Thank you!

1 Like

Hi, I have been able to get course-v3 running reliably on my Windows 10 laptop (/w 1050 TI GPU).

Here are the steps: https://github.com/parthopdas/c-fastai2019/blob/master/README.md
I have also verified with nvidia-smi that my GPU is indeed getting used while training.

Checkout the few scripts under the tools folder.

Let me know how it goes for you.

7 Likes

This is a really good tip. Saves a lot of time. Definitely going to use. Thanks!!

It’s weird when I lunch jupyter notebook from fastai env ( installed from coursev1 and updated) it shows nothing (blank page with 302 get error) however when I lunch jupyter notebook without env everything works fine and I can execute nb cells and train models, etc…
Should I keep it this way or I need to launch it from fastai env ?

No luck setting up v3 course on win10. Followed instructions here. Either ordinal 242 problem, and if I follow fix instruction to fix it I get “the procedure entry point fatbinaryctl_createhandle” error. I tried fresh env with python 3.6.8, 3.7.1 and 3.7.2, pytorch different versions, mkl different versions, fastai different versions. fix one, break another

EDIT: For the [Intel MKL FATAL ERROR: Cannot load mkl_intel_thread.dll.] -error I finally found another fix removing some dlls from system32 that doesnt create a new problem:

does it work if you follow the instructions here? Set up course v3 on Windows

I have had the previous version of fastai installed and working fine on my Windows 10 laptop. I used @alice’s instructions and it shows a weird error after the following line-
conda install -c pytorch -c fastai fastai pytorch torchvision cuda92

This code tries to look for packages to be updated, installed and downloaded. All the packages get downloaded except for SpaCy 2.0.18. after downloading 40-50% it gives out the HTTPError everytime.

Not sure what’s going on. I also tried to do pip install spacy which worked but maybe not the required version. Not sure how to work around this and why this is happening.

Attached herewith is the snapshot of Anaconda Prompt

1 Like

Hi Alice,

I have gone through your steps but finally run jupyter notebook is showing error.

I just got started with fastai v3 on windows 10 and followed the above steps. There was an issue with the wrapt module. With conda command the latest was 1.11.1 so it complained about the dependency.

UnsatisfiableError: The following specifications were found to be incompatible with each other:

  • anaconda==2019.03=py37_0 -> astroid==2.2.5=py37_0 -> wrapt
  • anaconda==2019.03=py37_0 -> importlib_metadata==0.8=py37_0 -> zipp[version=’>=0.3.2’]
  • astroid -> wrapt
  • fastai -> spacy[version=’>=2.0.18’] -> thinc[version=’>=6.12.0,<6.13.0’] -> wrapt[version=’>=1.10.0,<1.11.0’]
  • pkgs/main/win-64::importlib_metadata==0.8=py37_0 -> zipp[version=’>=0.3.2’]
  • pkgs/main/win-64::path.py==11.5.0=py37_0 -> importlib_metadata[version=’>=0.5’]
  • pkgs/main/win-64::zipp==0.3.3=py37_1
  • pylint -> astroid[version=’>=2.2.0’] -> wrapt
  • spyder -> pylint -> astroid[version=’>=2.2.0’] -> wrapt
  • wrapt

Solution: I uninstalled wrapt and then used pip to download 1.11.2, which is the latest version.
After that step 4 is all fine.

This will create headaches which probably aren’t worth your while. A lot of the library is linked to your home folder of the current user, which is located in C. So if you’re choosing another drive you’ll have to manually change the directories basically every time you download something, or load something, and so on. So I’d advice against installing on another drive, speaking from experience…!

Sometimes, defaults are better.

Are you in the right conda environment? Is jupyter notebook loading the correct conda environment?

Cleaning a messy environment is rarely worth it, unless you know very well what you’re doing. If i were you I’d uninstall, remove as much as I can, and then make a clean install.

How i make clean installs:

  1. If you have any previous installations of any of the applications below, uninstall them.
  2. Update computer
  3. Install CUDA
  4. Install Anaconda (Click in “Add to Path”, even if they advice not to. If Anaconda has been properly uninstalled it’s fine.)
  5. In the Anaconda GUI (Anaconda Navigator), goto Environments->Create (this links better with windows than only using command line)
  6. When the new environment has been created, enter cmd.exe and activate it, if everything works you should see (environment_name) C:\Users\...
  7. Install pytorch and fastai by conda install -c pytorch -c fastai fastai
  8. Start jupyter notebook, make a notebook and try to import fastai to see if it works. When launching the notebook, you have to be in the correct environment.
  9. Alternatively, load a previously git-cloned fastai notebook and simply try to run it

Done!

If Cuda has been properly installed there’s no need to install a specific version of it, since pytorch will snatch up whatever version is compatible for itself. Again, defaults are sometimes better!

1 Like

Hey Thanks for setup link, but i getting cuda error, when i execute cnn_learner lesson 1.


I installed using the command:
conda install -c pytorch -c fastai -c conda-forge fastai pytorch torchvision cuda100
should i install cuda92?