Windows 10 install guide for fastai v3

Hi!

I have a new Windows 10 laptop with a Nvidia GPU that I want to use for a local deep learning dev box - without having to rely on a cloud server.

I have successfully followed the 2018 “how to install on windows 10” guide and everything works fine.

I then cloned the guy repo for the v3 course however it doesn’t appear to have its own Conda environment (like 2018 does). I can use the 2018 environment but I it uses simlinks to an “…\old\fastai” directory.

I am mindful that the 2019 course may have a completely different set of libraries and dependencies so I thought I would ask if there was a windows 10 install guide for 2019 before I embark on (potentially) hours of error headbutting trying to get my env to work.

Any assistance appreciated.

3 Likes

Hi Gavin,

I’ve got it working for me, it does not replicate the setup you suggest in any way, but it was simple. It is described here:
https://forums.fast.ai/t/fastai-on-windows-how-it-worked-for-me/36637/3

For me the new course didn’t work on the 0.7 files.

Kind regards,
Kanter

I ended up creating an Ubuntu partition. Everything worked first time in this environment so I think I’ll stick with this.

Hi @gstrack
I am trying to setup fastai v3 on my local machine (Win 10) with Nvidia GTX 1070 Ti but until now I could not run fastai on my Jupyter notebook. Could u please help me through explaining the configurations works with u.

Thanks.

G’day @Nohaaw,
I wasn’t able to get a working Win10 development environment. I tried for many hours to make it work. I would encounter some kind of problem, spend hours searching the forums to find a fix (with most of the search results not working for me) until I would eventually find something that worked - only to hit another issue. After several days I decided to install Ubuntu alongside Win10 (i.e. dual boot). I have not encountered any problems using Ubuntu and I am seriously considering removing Win10 from my laptop all together.
On saying that, if you want to keep Win10, I would imagine that using Anaconda would probably be your best option. Create a fastai venv in Anaconda by cloning the base venv, then try and add fastai lib to that (if it isnt there already). Then run Jupyter Notebook through Anaconda with your fastai venv selected. Good luck!
Gav

Hi, course-v3 is running reliably on my Win10 laptop. Please refer Set up course v3 on Windows.

Hello, my guide on How to install fastai v1 on Windows 10. Hope it can help.

7 Likes

thanks @pierreguillou for the guide. after following it i have successfully imported fastai library, however i cannot go past this instruction (lesson1-pets.ipynb)
image
it stays there with “*” forever :frowning:
any idea how to fix this? thanks!

Hello @miwojc. I do not know what is happening but first of all, you need to check your installation.
For that, run the following command in your Anaconda Prompt terminal (after activation of your fastai environment):

python -m fastai.utils.show_install

You should get something like:

=== Software ===
python        : 3.6.8
fastai        : 1.0.46
fastprogress  : 0.1.19
torch         : 1.0.0
torch cuda    : 9.0 / is available
torch cudnn   : 7005 / is enabled

=== Hardware ===
torch devices : 1
  - gpu0      : GeForce GTX 1070

=== Environment ===
platform      : Windows-10-10.0.17134-SP0
conda env     : fastai_v1
python        : C:\user_path\Anaconda3\envs\fastai_v1\python.exe
sys.path      :
C:\user_path\Anaconda3\envs\fastai_v1\python36.zip
C:\user_path\Anaconda3\envs\fastai_v1\DLLs
C:\user_path\Anaconda3\envs\fastai_v1\lib
C:\user_path\Anaconda3\envs\fastai_v1
C:\user_path\Anaconda3\envs\fastai_v1\lib\site-packages
no nvidia-smi is found

If yes, I believe that your fastai installation is well done. My advice would be to restart your computer and see if you can reproduce the same error.

3 Likes

You most likely will have to downgrade your pytorch installation.

2 Likes

@pierreguillou , your guide is really great! Thanks for sharing!

1 Like

This is most likely the torch 1.0.1 hang issue.

To falsify that can you please do a ‘conda list’ and report back the pytorch version?

If it is pytorch 1.0.1 please do conda uninstal pytorch followed by conda install pytorch==1.0.0 - that should get rid of the hang.

In antly case it’s currently filed here. I should get to in a day or 2 but if someone else has spare cycles they are welcome to take it up.

2 Likes

thank you @pierreguillou @partho @ilovescience
i have downgraded torch
installed torchvision
upgraded conda and fastai (fastai updated to 1.0.38)
changed regex for windows

and was able to train network, however it kind of hangs in between epochs, once in epoch it run fast but in between epochs there is a long wait time like 2 minutes or so. it took 6 minutes to train on 2070
image
not sure what could be the issue?

=== Software ===
python        : 3.6.8
fastai        : 1.0.38
fastprogress  : 0.1.20
torch         : 1.0.0
torch cuda    : 9.0 / is available
torch cudnn   : 7005 / is enabled

=== Hardware ===
torch devices : 1
  - gpu0      : GeForce RTX 2070

=== Environment ===
platform      : Windows-10-10.0.17134-SP0
conda env     : fastai
python        : C:\Users\pc\Anaconda3\envs\fastai\python.exe
sys.path      :
C:\Users\pc\Anaconda3\envs\fastai\python36.zip
C:\Users\pc\Anaconda3\envs\fastai\DLLs
C:\Users\pc\Anaconda3\envs\fastai\lib
C:\Users\pc\Anaconda3\envs\fastai
C:\Users\pc\Anaconda3\envs\fastai\lib\site-packages
C:\Users\pc\Anaconda3\envs\fastai\lib\site-packages\win32
C:\Users\pc\Anaconda3\envs\fastai\lib\site-packages\win32\lib
C:\Users\pc\Anaconda3\envs\fastai\lib\site-packages\Pythonwin
no nvidia-smi is found

Hi @pierreguillou @partho @ilovescience , I got kind of a similar problem here. Execution is very slow and freezes at creat_cnn comand. Then I did a “torch.cuda.is_available()” command and it returned “false”.
My laptop is a MSI GS65 with GTX 1070.
My installation is:

=== Software ===
python       : 3.6.8
fastai       : 1.0.46
fastprogress : 0.1.20
torch        : 1.0.1
torch cuda   : 10.0 / is **Not available**

=== Hardware ===
No GPUs available

=== Environment ===
platform     : Windows-10-10.0.17134-SP0
conda env    : fastai_v1
python       : C:\Users\Fernando\Anaconda3\envs\fastai_v1\python.exe
sys.path     :
C:\Users\Fernando\Anaconda3\envs\fastai_v1\python36.zip
C:\Users\Fernando\Anaconda3\envs\fastai_v1\DLLs
C:\Users\Fernando\Anaconda3\envs\fastai_v1\lib
C:\Users\Fernando\Anaconda3\envs\fastai_v1
C:\Users\Fernando\Anaconda3\envs\fastai_v1\lib\site-packages
no supported gpus found on this system

Any idea on how to fix this? Thanks !

[ EDIT ] : better code in this post.


Hello @NandoBr. You have the wrong Pytorch version (torch : 1.0.1). You must have 1.0.0.
You can run the 2 following lines to solve the problem (inspiration from the post of @partho) :

conda uninstall pytorch
conda install fastai pytorch=1.0.0 -c fastai -c pytorch -c conda-forge

The first line will uninstall fastai, pytorch and torchvision.
The second one will install the right versions of fastai (the official one), pytorch (1.0.0) and torchvision (note: conda install fastai pytorch=1.0.0 -c fastai -c pytorch could be enough, but the addition of the conda-forge channel allows to get for sure the official version of fastai).

I’ve updated my medium post with them.

2 Likes

Hi @partho. Just to say you are right in the process (uninstall pytorch and then, install version 1.0.0 of pytorch) but the right lines are the following ones because conda uninstall pytorch uninstall as well fastai and torchvision:

conda uninstall pytorch
conda install fastai pytorch=1.0.0 -c fastai -c pytorch -c conda-forge

Hi @pierreguillou. Thanks for your medium post it is very useful. I followed your instructions and installed the following environment:

=== Software ===
python        : 3.6.8
fastai        : 1.0.46
fastprogress  : 0.1.20
torch         : 1.0.0
torch cuda    : 9.0 / is available
torch cudnn   : 7005 / is enabled

=== Hardware ===
torch devices : 1
  - gpu0      : GeForce GTX 1080

=== Environment ===
platform      : Windows-10-10.0.16299-SP0
conda env     : fastai_v1
python        : C:\Users\lproc\AppData\Local\Continuum\anaconda3\envs\fastai_v1\python.exe
sys.path      :
C:\Users\lproc\AppData\Local\Continuum\anaconda3\envs\fastai_v1\python36.zip
C:\Users\lproc\AppData\Local\Continuum\anaconda3\envs\fastai_v1\DLLs
C:\Users\lproc\AppData\Local\Continuum\anaconda3\envs\fastai_v1\lib
C:\Users\lproc\AppData\Local\Continuum\anaconda3\envs\fastai_v1
C:\Users\lproc\AppData\Local\Continuum\anaconda3\envs\fastai_v1\lib\site-packages
no nvidia-smi is found

When I run any notebook I get an error which points to a problem with tornado and nbconvert.
Here are their versions:

# Name                    Version                   Build  Channel
tornado                   6.0.1            py36hfa6e2cd_0    conda-forge

(fastai_v1) C:\sandbox\course-v3>conda list nbconvert
# packages in environment at C:\Users\lproc\AppData\Local\Continuum\anaconda3\envs\fastai_v1:
#
# Name                    Version                   Build  Channel
nbconvert                 5.3.1                    py36_0

There is in fact a bug report for this already:

I’m curious what versions of fastai, nbconvert, and tornado you are using successfully. Any suggestions on how to change/downgrade versions would be appreciated! When I try to uninstall tornado it wants to uninstall fastai and many other dependencies.

Exception details below:

E 17:15:24.511 NotebookApp] Uncaught exception GET /notebooks/nbs/dl1/00_notebook_tutorial.ipynb (::1)
    HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/notebooks/nbs/dl1/00_notebook_tutorial.ipynb', version='HTTP/1.1', remote_ip='::1')
    Traceback (most recent call last):
      File "C:\Users\lproc\AppData\Local\Continuum\anaconda3\envs\fastai_v1\lib\site-packages\tornado\web.py", line 1697, in _execute
        result = method(*self.path_args, **self.path_kwargs)
      File "C:\Users\lproc\AppData\Local\Continuum\anaconda3\envs\fastai_v1\lib\site-packages\tornado\web.py", line 3174, in wrapper
        return method(self, *args, **kwargs)
      File "C:\Users\lproc\AppData\Local\Continuum\anaconda3\envs\fastai_v1\lib\site-packages\notebook\notebook\handlers.py", line 59, in get
        get_custom_frontend_exporters=get_custom_frontend_exporters
      File "C:\Users\lproc\AppData\Local\Continuum\anaconda3\envs\fastai_v1\lib\site-packages\notebook\base\handlers.py", line 462, in render_template
        return template.render(**ns)
      File "C:\Users\lproc\AppData\Local\Continuum\anaconda3\envs\fastai_v1\lib\site-packages\jinja2\asyncsupport.py", line 76, in render
        return original_render(self, *args, **kwargs)
      File "C:\Users\lproc\AppData\Local\Continuum\anaconda3\envs\fastai_v1\lib\site-packages\jinja2\environment.py", line 1008, in render
        return self.environment.handle_exception(exc_info, True)
      File "C:\Users\lproc\AppData\Local\Continuum\anaconda3\envs\fastai_v1\lib\site-packages\jinja2\environment.py", line 780, in handle_exception
        reraise(exc_type, exc_value, tb)
      File "C:\Users\lproc\AppData\Local\Continuum\anaconda3\envs\fastai_v1\lib\site-packages\jinja2\_compat.py", line 37, in reraise
        raise value.with_traceback(tb)
      File "C:\Users\lproc\AppData\Local\Continuum\anaconda3\envs\fastai_v1\lib\site-packages\notebook\templates\notebook.html", line 1, in top-level template code
        {% extends "page.html" %}
      File "C:\Users\lproc\AppData\Local\Continuum\anaconda3\envs\fastai_v1\lib\site-packages\notebook\templates\page.html", line 154, in top-level template code
        {% block header %}
      File "C:\Users\lproc\AppData\Local\Continuum\anaconda3\envs\fastai_v1\lib\site-packages\notebook\templates\notebook.html", line 120, in block "header"
        {% for exporter in get_custom_frontend_exporters() %}
      File "C:\Users\lproc\AppData\Local\Continuum\anaconda3\envs\fastai_v1\lib\site-packages\notebook\notebook\handlers.py", line 19, in get_custom_frontend_exporters
        from nbconvert.exporters.base import get_export_names, get_exporter
      File "C:\Users\lproc\AppData\Local\Continuum\anaconda3\envs\fastai_v1\lib\site-packages\nbconvert\__init__.py", line 7, in <module>
        from . import postprocessors
      File "C:\Users\lproc\AppData\Local\Continuum\anaconda3\envs\fastai_v1\lib\site-packages\nbconvert\postprocessors\__init__.py", line 5, in <module>
        from .serve import ServePostProcessor
      File "C:\Users\lproc\AppData\Local\Continuum\anaconda3\envs\fastai_v1\lib\site-packages\nbconvert\postprocessors\serve.py", line 19, in <module>
        class ProxyHandler(web.RequestHandler):
      File "C:\Users\lproc\AppData\Local\Continuum\anaconda3\envs\fastai_v1\lib\site-packages\nbconvert\postprocessors\serve.py", line 21, in ProxyHandler
        @web.asynchronous
    AttributeError: module 'tornado.web' has no attribute 'asynchronous'
[E 17:15:24.526 NotebookApp] {
      "Host": "localhost:8888",
      "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0",
      "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
      "Accept-Language": "en-US,en;q=0.5",
      "Accept-Encoding": "gzip, deflate",
      "Referer": "http://localhost:8888/tree/nbs/dl1",
      "Connection": "keep-alive",
      "Cookie": "username-localhost-8888=\"2|1:0|10:1551737682|23:username-localhost-8888|44:NWIwYjA5OTlhOGY1NGE5ZDg0ODhmYzBjM2NkMDc2N2Y=|d8ee8e494b7789f8ff2961c53344a3cb4003df5e89c5526312d0b95b605add10\"; _xsrf=2|7026f6dd|d73694ff5614dc301cc7515c72703e9d|1551734957",
      "Upgrade-Insecure-Requests": "1"
    }
[E 17:15:24.526 NotebookApp] 500 GET /notebooks/nbs/dl1/00_notebook_tutorial.ipynb (::1) 109.39ms referer=http://localhost:8888/tree/nbs/dl1

Thank you!

Hi @turntwo463.

I have fastai 1.0.46 installed and in my fastai environment, I have the following versions of tornado and nbconvert:

(fastai_v1) C:\user_path>conda list nbconvert
# packages in environment at C:\user_path\Anaconda3\envs\fastai_v1:
#
# Name                    Version                   Build  Channel
nbconvert                 5.3.1                    py36_0

(fastai_v1) C:\user_path>conda list tornado
# packages in environment at C:\user_path\Anaconda3\envs\fastai_v1:
#
# Name                    Version                   Build  Channel
tornado                   5.1.1            py36hfa6e2cd_0

I do not know why you have tornado version 6.0.1.

You could try:

conda uninstall tornado
conda install fastai pytorch=1.0.0 -c fastai -c pytorch -c conda-forge

Hi @pierreguillou

I believe tornado 6 release came out in the last day or two. So if the fastai build specifies to get the latest version, I believe that is how I wind up with tornado 6.

I already started with the command:

conda install fastai pytorch=1.0.0 -c fastai -c pytorch -c conda-forge

so don’t think that will help.

Sounds like I may need to dig into the fastai build scripts and hardcode dependencies to the older versions of tornado and nbconvert. Does that make sense?

Thanks again.

Hi @pierreguillou

I was able to get the notebook running by uninstalling/reinstalling tornado, and then reinstalling several dependencies that were removed as part of the tornado uninstall.

I’m not claiming this is the optimal approach, but here are my steps:

conda uninstall tornado
conda install tornado=5.1.1
conda install fastai pytorch=1.0.0 -c fastai -c pytorch -c conda-forge
conda install nbconvert
conda install jupyter -c conda-forge