How to set up Windows 10 for fast.ai


(Jeremy Howard) #43

I did test it on Windows, but it was quite a while ago so I don’t remember the details.


(Andrea de Luca) #44

Ok fellas,
Jeremy tested the new instructions successfully, my machine works like a charm with the older ones.
Following either the new or the old instructions, you should be able to get a windows box ready for Fastai course(s).

It is up to you to solve minor issues. That said, I’m pretty convinced that this community will be fully supportive. :slight_smile:


#45

To be clear, I am installing windows 10 native.
Having installed this numerous times on numerous machines I will say that I have had success only with the “old” instructions (pip install fastai with a followup pip install torchvision), and also the instructions by cklukas referenced in this thread. I have not had success using the “new” instructions (conda env update).


(Jeremy Howard) #46

@FourMoBro I’d be interested in seeing a screenshot or similar of the errors, if you have one.


#47

Sure thing, boss…

Full disclosure:
Since this is windows, and people want the ease of use icons and such, I wanted to make a step by step limiting the number of command line inputs. I did take pictures along the way hoping to make a .md file

A The environment was made with Anaconda Navigator using only python 3.6.
B The env was activated via that interface and taken to a command line…
C …where pytorch was installed.
D-E The fastai code was cloned using Github for desktop which is why you do not see that here.
F This is the output of running “conda env update”


(Andrea de Luca) #48

While we can manage to get a decent setup with my older instructions (or cklukas’), it would be great if Fastai could offer “official” instructions for windows.

Some users prefer (or are forced) to use windows for a lot of reasons. For example, in my case:

  1. I have a lot of windows-related stuff to keep in check while I’m studying deep learning.
  2. Terminal multiplexing is great, but one may require easy GUI remote access (see point 1). While that’s doable under linux, it’s somewhat trickier and pose some serious security threats unless one can spend days getting the system properly armoured.
  3. On my workstation, Windows 10 idles at ~30W, while Linux idles at ~55W, almost twice, no matter how much I tried to optimize it for power consumption.
    This can be an issue if you live (like me) in a country where electricity is not cheap, and you use your workstation sixteen hours a day.
  4. I use linux since 1997, but I’m frankly sick tired of having window manager crashes and of wasting time googling for any issue I have, no matter how beautiful Unix is.
  5. OS X is a great alternative, but those geniuses at Apple decided to make it impossible to use a nvidia card with a Mac.

Last but not least, people may prefer not to go with rented remote instances because it is somewhat annoying to constantly worry about the bill. Furthermore, being able to build and configure a deep learning workstation is a valuable skill to acquire by itself no matter the OS one chooses.


(Jeremy Howard) #49

Yes I don’t need any convincing. I use Windows too. However pytorch doesn’t support windows officially yet, so we’re holding off until it does (which should be in the next main release 0.4).


(Jeremy Howard) #50

OK so it looks like you’ll need to install torchvision from the peterjc123 channel (ie conda install -c peterjc123 pytorch cuda90 torchvision). The other packages don’t look like things we actually need. So try commenting them out from the environment.yml file and see if it works.

Many thanks!


#51

good news bad news…

I could swear that I have tried to install torchvision from the peterjc123 channel before, like you suggest, but it appears that it is no longer there, or I was mistaken, or i can’t type. Nevertheless, I commented out the problem items, and put torchvision in the pip section of the yml file. I did the conda env update and everything appeared to install correctly.

Once installed I ran the first notebook only for it to crash out at the self.crit stage with the Long Tensor/Int Tensor error that has been documented before, but I don’t feel like investigating/fixing at the moment.


(Jeremy Howard) #52

Sorry for being slow - but could you show me the error you’re referring to?

edit oh sorry I know the one you mean. That’s not related to the installation, but to how windows handles different int sizes. I suspect we could fixing it by changing the T() function in fastai to always create LongTensor for int types. AFAIK we never actually use 32 bit ints.


(Jeremy Howard) #53

BTW I’ve moved the thread out of the beginner forum, since using fast.ai on windows really isn’t for beginners just yet! :slight_smile:


(Jeremy Howard) #54

OK based on @FourMoBro’s feedback I’ve now added an environment-win.yml file to the repo. This yml file comments out the problematic libraries, moves torchvision to the pip section, and adds the peterjc123 channel. Therefore, you should be able to now install on windows from this file without any extra steps (i.e. without manually installing torch etc with the -c peterjc123 flag).

So after cloning the repo, just cd to it and type:

 conda env create -f environment-win.yml
 activate fastai

…and in theory you should be up and running! I haven’t tested this so reports of success of failure welcomed. :slight_smile:


#55

i know you meant “environment-win.yml”. At any rate I did my goofy graphical way and it seems to do the trick. I only needed to set the PYTHONPATH to fastai directory. I then ran lesson 1 notebook from cklukas and it is progressing just dandy. I will try to make a nice new post or link tomorrow for which you can link in the FAQ and shut this thread down.


(Andrea de Luca) #56

:sunglasses::rofl:


(Jeremy Howard) #57

That works. Another approach is to create a windows directory symlink in the notebooks folder to the fastai lib, like we do for linux. It’s the /d flag to mklink, as discussed here: https://www.howtogeek.com/howto/16226/complete-guide-to-symbolic-links-symlinks-on-windows-or-linux/ .


(Chamin Nalinda) #58

I see. Just noted that :slight_smile:


(Kashish Jain) #59

Getting an error DLL load failed: the specified module cannot be found. I didn’t made a new env I added the git code in an existing environment. OS -windows 10.


(Andrea de Luca) #60

Did you follow the old or the new guide? Or cklukas’?
Did you get error messages during the installation process?


(Andrea de Luca) #61

God, I hope you won’t get me shot by a firing squad! :joy:


(Andrea de Luca) #62

Great, thanks. :slight_smile:

I have updated the “new” instructions: a reader would probably have had difficulties reading till the 51th post.