Windows 10 Installation Notes (Windows command and WSL bash)

Thanks Robert, again :smiley:

1 Like

The latest fixes on fastai’s github allow lesson1 to complete without error. Previously lesson1 would error out at the 80% mark. True for all platforms.

git clone https://github.com/fastai/fastai

Windows users will need to slightly modify the lesson1 file. The difference being the replacement of non-portable bash shell commands with cross-platform python code. I’ve attached a pdf of a run of lesson1 on Windows + GPU which shows the replacements for the bash commands. – No I haven’t. The file is too large. I’ll have to post some other way.

pytorch for Windows has been updated to use CUDA 9.0. tensorflow-gpu still requires CUDA 8.0. I’ve installed CUDA 8 and CUDA 9 side-by-side without problem. I can now use CUDA 9 with pytorch and CUDA 8 with tensorflow-gpu.

conda install -c peterjc123 pytorch cuda90

The next version of pytorch, version 0.40, is suppose to officially support Windows.

1 Like

I’ve just pushed the change to add long() when calling self.crit. Let me know if you see any problems.

I reran Lesson1 on Windows-gpu. It completed without errors. Thanks for committing the changes.

N.B. I use these commands to update changes at https://github.com/fastai/fastai master. The commands will update changes from master without deleting files not tracked by git (e.g. courses/dl1/data). Important: If you have any local changes that are tracked by git, they will be lost. With or without --hard option, any local commits that haven’t been pushed will be lost.

git fetch --all
git reset --hard origin/master

Good Stackoverflow discussion of git commands for updating. Many alternatives commands are suggested. Depends on your git situation.

How do I force git pull to overwrite local files?

1 Like

Tensorflow 1.5 rc is now available for Windows GPU. It uses CUDA 9.0. The release version, perhaps Feb 1st, will support CUDA 9.1 (current).

Well, I didn’t see this thread before… so I wrote (kind of again) a description on how I got the library working with GPU acceleration under Windows 10: https://github.com/cklukas/fastai/blob/master/doc/windows_setup.md

I needed to adjust a little of the notebook code, e.g. when listing directories, etc… Otherwise at least the first few notebooks worked very fine in my tests.

1 Like

@klukas Very nice writeup. I’ll try to find some time to merge this thread’s notes with your writeup.

I followed your instructions to make lesson1 work on my win10 machine(GTX1060) . But it is very slow.It takes about two hours to finish model run. It seems it uses CPU not GPU. Do I need more configuration to make it work on GPU?

Did you install the cuda and cudnn drivers from nvidia.com?

CUDA:

https://developer.nvidia.com/cuda-downloads?target_os=Windows&target_arch=x86_64

CUDNN:

I have CUDA 8.0 and CUDA 9.1 installed. I think I use CUDA 8 for Keras and 9.x for pytorch, but I am not 100% sure…

fastai needs a prerequisites validation test suite. People could run it to verify their installation including GPU compatibility. Here’s a one liner which displays GPU compatibility with Tensorflow. The output will show whether a GPU has been found or not. If your GPU isn’t mentioned, it’s not visible to Tensorflow.

python -c "import tensorflow as tf;sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))"

I did this but instead got this error:-


TypeError: eq received an invalid combination of arguments - got (torch.cuda.IntTensor), but expected one of:

  • (int value)
    didn’t match because some of the arguments have invalid types: (torch.cuda.IntTensor)
  • (torch.cuda.LongTensor other)
    didn’t match because some of the arguments have invalid types: (torch.cuda.IntTensor)

Running now I had to apply extra patch, which is:

in model.py file
res.append([f(preds.data,y) for f in metrics])
res.append([f(preds.data,y.long()) for f in metrics]) #patch

1 Like

OK fix to the LongTensor problem is now pushed. I’ll work on posting an official install guide after lunch.

I’ve discovered, but haven’t reported, that the fix to LongTensor might fix lesson1 but break lesson2. Looking at some discussions on pytorch forums, it looks like there might be some mitigations already made to pytorch but not in peterjc123’s 0.3 Windows version. I haven’t looked into it because the official Pytorch for Windows, part of pytorch 0.4, could drop as early as this week (per peterjc123). Of course, delays are the rule. Applying the programmer tardiness rule of 2x, that would put the date at end of February. My intuition is the fix should be within pytorch and fast.ai’s usage is reasonable.

Wow thanks

I got the lesson4 imdb sentiment notebook to work on windows 10 with WSL on the cpu.
pytorch-cpu version 0.4.0 did not work, but 0.3.1 worked together with the latest torchvision:

conda install pytorch-cpu=0.3.1 -c soumith
pip install torchvision

Spacy wouldn’t install at first (without gcc) but this worked:

sudo apt-get install build-essential
pip install spacy --upgrade
python -m spacy download en

That what i ended up doing. Guess wsl can be used in cpu mode ?

I am sorry to revive this topic.
Just a quick question about WSL and GPU.
Do you have any recent update on that matter? Is it a dead end?

I am stuck to windows 10 (corporate laptop) at work. Everything is fine on windows but I have tried wsl (essentially to use +vim config from Jeremy). Everything works except when running on GPU. (Lesson 10 - 2019)

Microsoft knows native GPU support is a highly requested WSL feature. Microsoft is working towards GPU support but there’s lots of plumbing required. I expect an update on their progress at the next developer conference, IIRC, April 2020. For the machine learning community, GPU support in WSL is a big deal. An alternative is to use Unraid with its GPU passthrough feature.

1 Like