Fastai2 on Windows

ah, okay got it, it’s working for me now. Thanks!

I downgraded pytorch to 1.2.0 as recommended. It seems working, then I update fastai2, it downgrade my fastcore and have the following error. It unstalled my fastcore, but it seems install the same version again. Any idea to fix it?
ERROR: fastai2 0.0.17 has requirement torch>=1.3.0, but you’ll have torch 1.2.0 which is incompatible.
ERROR: fastai2 0.0.17 has requirement torchvision>=0.5, but you’ll have torchvision 0.4.0 which is incompatible. I updated my fastcore and the nameError ‘log_args’ is not defined’ and now this error shown up again. Current fastcore=0.1.17.

fastai requires PyTorch 1.3.1 minimum, so you need to install this version (or wait for PyTorch to release it if it’s not available already).
As for the log_args, it’s because you need to do an editable install of fastcore to go with your editable install of fastai2.

1 Like

You need to install the PyTorch 1.4 release for Windows.

1 Like

I think Windows may not be appropriate for DL practice. Although I use Windows for DL, I find it better to train the methods in Cloud or Linux environment.

OK.
I just want to clarify the following side note from Jeremy is for Colab in Window and not window in general. I will try the latest pytorch. Thanks.

A side note for windows:
Currently, pytorch==1.2.0 torchvision==0.4.0 is recomended and working (1.3.1 is not available on offical pytorch site and 1.4 is most recent but not working properly.)
In

Yes, but this a point in the topic that has not been updated in a while (this is a wiki, so if some new PyTorch versions are available on Windows, fell free to update it).

We are pinned to PyTorch 1.3.1 and torchivision 0.5.0 minimum right now, as we rely on behavior introduced in those versions. PyTorch 1.4.0 used to not work with fastai v2 but this has all been fixed now, so check you can install it properly on Windows and then edit the mentioned topic :slight_smile: .

2 Likes

As Sylvain mentioned the docs are out-dated. Here is my setup info if it helps:

fastai2 Version: 0.0.17
nbdev Version: nbdev not found
fastprogress Version: 0.2.3
fastpages Version: fastpages not found

python Version: 3.7.7 (default, Mar 23 2020, 23:19:08) [MSC v.1916 64 bit (AMD64)]
torchvision: 0.5.0
torch version: 1.4.0

I followed the directions on the github page and also installed pytorch as I have Cuda9.2 from the pytorch website: In my case: conda install pytorch torchvision cudatoolkit=9.2 -c pytorch -c defaults -c numba/label/dev

Tried to reinstall Pytorch 1.4.0, and found:
"The following specifications were found to be incompatible with your CUDA driver:

  • feature:/win-64::__cuda==10.2=0
  • feature:|@/win-64::__cuda==10.2=0

Your installed CUDA driver is: 10.2"

Need to down grade CUDA.

1 Like

I added that note and at that time it was problematic. I didn’t test the very recent 1.4 version pytorch. If you use conda you can install 1.3.1 with specifed version. Still you can not find 1.3.1 on the official pytorch site. You can install multiple cuda versions with the correct path naming.

Thank you for reply. Is there any requirement.txt file for both fastai2 and fastcore Win 10?

I think it gets it from environment.yml file. Also, don’t forget to activate your environment from command line even if you use base environment. conda does not add it to path any more…

Mine is still not working, after I downgraded to Cuda 9. The environment.yml didn’t include Cuda. As I tried to install in different version of cuda or pytorch, it at the end uninstall something and then install something. End up it seems to be the same version of the uninstalled version. Thus, can you clarify which version to use. I notice that it is in the critical development stage between fastai1 and fastai2. I would appreciate if you can help me to clarify version that I needed for pytorch, torchvision and cuda. If you or the developers want me to try out different candidates, please give me a lists a may be able to try out different candidates.
I have been trying GCP, Win10, Ubuntu 19 Vbox in Win10, Gradient, Colab.
I was working with fastai ver1, which seem working fine for me. Then I thought there is no point to learned old version with new version coming out soon in a couple months and I need to learn the new version again.
Thanks.

my install seems using cuda10.1 with
pip install torch===1.4.0 torchvision===0.5.0 -f https://download.pytorch.org/whl/torch_stable.html

but I saw many other library remains of old install. I’s a mess right now :slight_smile:

Quick question? Are you having trouble with installing regular fastai2 or the editable install or both?

I have no trouble to install it and import fastai2. I think I had problem of training data, which is related to CUDA or GPU. I may have the setting wrong, but torch.cuda.is_avaiable == true, CUDA version now is 10.2.

good to hear all good now

Nice that you solved it. you should set number of workers for data loaders to 0. If not there you should add it. It cause many problems on windows. Also you need to install pip install --no-deps -e “.[dev]” I don’t install with dependencies… I update fastcore manually if needed.

hello, can you tell me how do you get working on a windows machine with num_workers set to 0? If I set the variable in the dataloader( I hope you are talking about dataloader inside torch/utils folder), I will get error at contractor of_MultiProcessingDataLoaderIter

super(_MultiProcessingDataLoaderIter, self).init(loader)
assert self._num_workers > 0

    if loader.multiprocessing_context is None:
        multiprocessing_context = multiprocessing
    else:
        multiprocessing_context = loader.multiprocessing_context

Can you help me? I got stuck in chapter1 and I just started this course. Can you provide information about the library version that got you running without error?

Thank you in advance.

Window or Not Window? Should this be a question?

What if your computer came with Window:

I think I tried hard with local Win10 in a notebook with
32G RAM, i7CPU, 1050Ti GPU, 250 SSD and 1T HD
Maybe I didn’t try hard enough.

Short answer:
I’ll try something else, rather than running fastai2 in Win10 locally. I may try Vbox with the new release of Ubuntu 20 in a few days.

Long answer, Here I shared my experience:

  1. Virtualbox or other virtual machines with Ubuntu??
    It used to have issues with GPU drivers in Ubuntu 18 in Vbox, but it seems working better in Ubuntu 19.
  2. Running Ubuntu 18(Window Sub Linux), it only allows me to install that in my SSD, which is almost full.
  3. Fastai2 running in the cloud is a general trend. Thus, I am moving to that direction with the Google Cloud Platform.

I would like to optimize my hardware locally, plus the advantage of cloud computing. Any recommendation?