Howto: installation on Windows

@jeremy Thank you for excellent and useful write-up on installation on Windows.

@Oonej and others: I will appreciate your help on the following.

“from fastai.imports import *” cell in lesson1 in Jupyter Notebook on my computer leads to the following error.

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-2-2f3a3d7866ce> in <module>()
      1 # This file contains all the main external libs we'll use
----> 2 from fastai.imports import *

C:\Windows\System32\fastai\courses\dl1\fastai\imports.py in <module>()
     13 from pandas_summary import DataFrameSummary
     14 from IPython.lib.display import FileLink
---> 15 from PIL import Image, ImageEnhance, ImageOps
     16 from sklearn import metrics, ensemble, preprocessing
     17 from operator import itemgetter, attrgetter

C:\Programs\Anaconda3\lib\site-packages\PIL\Image.py in <module>()
     56     # Also note that Image.core is not a publicly documented interface,
     57     # and should be considered private and subject to change.
---> 58     from . import _imaging as core
     59     if PILLOW_VERSION != getattr(core, 'PILLOW_VERSION', None):
     60         raise ImportError("The _imaging extension was built for another "

ImportError: DLL load failed: The specified module could not be found.

Guys I am getting an error of kernel dead for fastai lesson1-rxt50 , I am using “custom_kernel” as mentioned in other threads. I am working on google compute console with 52GB ram and 8 CPU on ubuntu 16.04. Please someone help me out. thanks ,

It means that Ubuntu for Windows can not be used in order to get Fastai running on a GPU on Windows ?

Correct. No CUDA support in WSL

@jeremy,

I have questions about your process that does not work until now on my computer (windows 10, GeForce GTX 1070) :

  1. Why do we install Git for Windows as we don’t open it after ?
    EDIT : I got it (it installs in Anaconda Prompt Terminal the git functions and even the unix commands if selected during the installation process)

  2. I can not use the command del in my Anaconda Prompt Terminal, only rmdir : you know why ?
    EDIT : it works now after a new installation of GIT for Windows with the Unix Command option selected.

  3. I followed your howto guide but I got at the end a “Kernel error” after launching my jupyter notebook with the following list or errors :
    EDIT : my kernel python3 works now. It was my kernel.json at C:\Users%username%\AppData\Roaming\jupyter\kernels\python3\kernel.json that had an old path to python.exe

Traceback (most recent call last):
  File "C:\Users\alienware\Anaconda3\envs\fastai\lib\site-packages\tornado\web.py", line 1512, in _execute
    result = yield result
  File "C:\Users\alienware\Anaconda3\envs\fastai\lib\site-packages\tornado\gen.py", line 1055, in run
    value = future.result()
  File "C:\Users\alienware\Anaconda3\envs\fastai\lib\site-packages\tornado\concurrent.py", line 238, in result
    raise_exc_info(self._exc_info)
  File "<string>", line 4, in raise_exc_info
  File "C:\Users\alienware\Anaconda3\envs\fastai\lib\site-packages\tornado\gen.py", line 1063, in run
    yielded = self.gen.throw(*exc_info)
  File "C:\Users\alienware\Anaconda3\envs\fastai\lib\site-packages\notebook\services\sessions\handlers.py", line 73, in post
    type=mtype))
  File "C:\Users\alienware\Anaconda3\envs\fastai\lib\site-packages\tornado\gen.py", line 1055, in run
    value = future.result()
  File "C:\Users\alienware\Anaconda3\envs\fastai\lib\site-packages\tornado\concurrent.py", line 238, in result
    raise_exc_info(self._exc_info)
  File "<string>", line 4, in raise_exc_info
  File "C:\Users\alienware\Anaconda3\envs\fastai\lib\site-packages\tornado\gen.py", line 1063, in run
    yielded = self.gen.throw(*exc_info)
  File "C:\Users\alienware\Anaconda3\envs\fastai\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 79, in create_session
    kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name)
  File "C:\Users\alienware\Anaconda3\envs\fastai\lib\site-packages\tornado\gen.py", line 1055, in run
    value = future.result()
  File "C:\Users\alienware\Anaconda3\envs\fastai\lib\site-packages\tornado\concurrent.py", line 238, in result
    raise_exc_info(self._exc_info)
  File "<string>", line 4, in raise_exc_info
  File "C:\Users\alienware\Anaconda3\envs\fastai\lib\site-packages\tornado\gen.py", line 1063, in run
    yielded = self.gen.throw(*exc_info)
  File "C:\Users\alienware\Anaconda3\envs\fastai\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 92, in start_kernel_for_session
    self.kernel_manager.start_kernel(path=kernel_path, kernel_name=kernel_name)
  File "C:\Users\alienware\Anaconda3\envs\fastai\lib\site-packages\tornado\gen.py", line 1055, in run
    value = future.result()
  File "C:\Users\alienware\Anaconda3\envs\fastai\lib\site-packages\tornado\concurrent.py", line 238, in result
    raise_exc_info(self._exc_info)
  File "<string>", line 4, in raise_exc_info
  File "C:\Users\alienware\Anaconda3\envs\fastai\lib\site-packages\tornado\gen.py", line 307, in wrapper
    yielded = next(result)
  File "C:\Users\alienware\Anaconda3\envs\fastai\lib\site-packages\notebook\services\kernels\kernelmanager.py", line 148, in start_kernel
    super(MappingKernelManager, self).start_kernel(**kwargs)
  File "C:\Users\alienware\Anaconda3\envs\fastai\lib\site-packages\jupyter_client\multikernelmanager.py", line 110, in start_kernel
    km.start_kernel(**kwargs)
  File "C:\Users\alienware\Anaconda3\envs\fastai\lib\site-packages\jupyter_client\manager.py", line 259, in start_kernel
    **kw)
  File "C:\Users\alienware\Anaconda3\envs\fastai\lib\site-packages\jupyter_client\manager.py", line 204, in _launch_kernel
    return launch_kernel(kernel_cmd, **kw)
  File "C:\Users\alienware\Anaconda3\envs\fastai\lib\site-packages\jupyter_client\launcher.py", line 128, in launch_kernel
    proc = Popen(cmd, **kwargs)
  File "C:\Users\alienware\Anaconda3\envs\fastai\lib\subprocess.py", line 709, in __init__
    restore_signals, start_new_session)
  File "C:\Users\alienware\Anaconda3\envs\fastai\lib\subprocess.py", line 997, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] Le fichier spécifié est introuvable
  1. My last error now is about ModuleNotFoundError: No module named 'bcolz'
    EDIT : it works now. It was again the wrong path to my python.exe in my kernel.json file.
1 Like

Following Jeremy post for custom installation in windows 10 with Nvidia GPU, I am stuck at conda env update
I did below steps,

  1. Already have Anaconda with Python=3.6 and Git.
  2. Opened Anaconda Prompt as admin
  3. Did git clone https://github.com/fastai/fastai.git'
  4. then cd fastai/fastai in which environment.yml is available.
  5. then when I do conda env update I get below error.
 ResolvePackageNotFound:
  - spacy

then based on few answers in above posts and in this link Lesson 4 - OSError: Can't find model 'en',
I ran below two commands and installed & downloaded spacy model successfully

pip install spacy
python -m spacy download en

then when I try to run 5th step again to proceed, I get same ResolvePackageNotFound spacy error. Other people are facing this problem when they run lesson4 notebooks, but I am facing during initial installation itself. Even after installing spacy why am I getting this error, can someone tell me how to proceed further? I have already went through most of the posts available and have been stuck for many hours on this issue.

If you install spacy already, try remove spacy from the environment file and rerun env update, I am guessing this files have been updated recently.

1 Like

I had the same issue, while attempting to use torch on CPU, what solved it for me is to uninstall pytorch
and install the pytorch-cpu version:

conda uninstall pytorch
conda install -c peterjc123 pytorch-cpu

It’s probably not relevant for you anymore but maybe it will help to someone else…

2 Likes

Hi, I have this error:


I have a laptop with an Nvidia GT 630M. I tried to update its drivers and reboot my computer but the error is still there. Any sugestions? Thank you.

I got the same problem exactly (on windows 7), and to fix it, i just needed to update conda!
so after the cd fastai, please try to launch conda update conda
and then the conda env update command.

As already mentioned in this thread, the PyTorch support for NVIDIA cards with compute capability <= 5 has ended. This means that my Windows-approach to deep learning does not work anymore. I spent considerable effort to make it work on Windows (because I had a laptop from my employer and wanted to use the GPU for something meaningful :slight_smile: ) but unfortunately I have to dismiss the idea and go back to AWS (which is not bad in anyway, but more expensive). It was clear from the start that these Windows laptops were not meant for deep learning, but as long as PyTorch support was given it worked out well. Now I have to give up unfortunately. That is my conclusion…

Great news!

1 Like

If you think your GPU is doing nothing, please note that in the task manager in the GPU view you can change one of the four diagrams to “Compute_0” and this will show it’s busy, just not with rendering 3D.

3 Likes

Really good news! Thank you for informing us!

The support is back for PyTorch 0.4.0 and window is officially supported now, you can check out Pytorch homepage.

1 Like

Hi @raelianer ,
Did you run any code that contains code m_vgg = to_gpu(vgg16(True)).eval() with to_gpu function?
I did part1 on my windows laptop with 960m, but now on part 2 I get error
" Found GPU0 GeForce GTX 960M which is of cuda capability 5.0." " PyTorch no longer supports this GPU because it is too old."

Update:
28.04.2018
cd to fastai directory in conda and writing conda env update installs pytorch 4 and this error is gone! All works. No need to install wheel or compile from source.

I just used conda install pytorch cuda91 -c pytorch - I tried conda env update afterwards and the problem came back.

I discovered fast.ai like two days ago, so all I’ve done so far is watching lesson one and running all cells of the jupyter notebook, which took about 1h 30m on my laptop (the second time I run it).

However after the update I get this warning:

C:\Users\Richard\fastai\courses\dl1\fastai\initializers.py:6: UserWarning: nn.init.kaiming_normal is now deprecated in favor of nn.init.kaiming_normal_.
if hasattr(m, ‘weight’): init_fn(m.weight)

I also wanted to pip3 install torchvision but since it was running fine without it and it comes with it’s own dependencies I decided to spare me the hassle.

1 Like

Works well, also for Windows 7.
I just executed
conda install pytorch cuda90 -c pytorch
in addition to the Windows 7 installation oulined above

@jeremy, in the jupyter notebook lesson4-imdb.ipynb, we use the find command which does not work in Anaconda Prompt (but works in Ubuntu terminal).

The code is : find {TRN} -name '*.txt' | xargs cat | wc -w (with an exclamation point before find if the code is run in the notebook).

Which code can I use instead ?

Thanks! I tried everything in this post and this final solution solved my issue. I had a CUDA 8.0 before I am not sure if this causes the issue. But Installing CUDA 9.0 works.