Howto: installation on Windows

I have a similar problem:

I tested also steps 1. - 6.

Using the same conda environment with keras and tensorflow it works with the command
os.environ[“CUDA_VISIBLE_DEVICES”] = ‘0’
But this command seems not to be working with fast.ai…

Another attempt was:
device = torch.device(‘cuda’ if torch.cuda.is_available() else ‘cpu’)
print(Using device: device)
This is printing: Using device cuda
But the CPU monitoring shows that 100 % is used.

Is this normal?

@ Jeremy, many thanks for the tutorials … I got confused when i got to 8-- , it seems from here onward, it doesn’t apply to the new course (dl v.3).

Any help on how to proceed will be appreciated…

1 Like

The setup doesnt work for courseV3 which is being taught in videos, I wasted so much time setting this up, only to realize later that the library has been upgraded,

Things I have done so far,
Since Lesson1-Pets notebook is not available in fastai repo, I cloned coursev3 repo, Created a symlink for fastai available in the fastai repo( not the …\old\fastai, but the newer one …\fastai) Still get the import error.

My 2018 course notebooks work fine, but not the latest coursev3 ones,

1 Like

@Taran, at first i thought i was doing something wrong…

Finally i got my gig to work through some trial and error !!! and it appears my gig is super fast e.g i ran the training set on cat & dogs and each epoch took ~ 2.30.\ minutes


It took me 3days to figure things out… i’m running on a win 10 with a NVIDIA GeForce RTX 2080 Ti and NVIDIA GeForce RTX 2070.
it is important when cloning from git rep not to forget to use the v3 repo https://github.com/fastai/course-v3.git

i will add detailed installation steps shortly for any absolute beginner like myself…

@hammao In the course V3 repo, Have you made any symlink for the fastai library, N the detailed set up guide will be very helpful

@Taran… you don’t need to do all that… the main difference is when you’re adding the GIT repo… just use the v3 repo instead of the one provided in this thread…

I will post a step by step procedure I used shortly

For Course V3 this guide works.

1 Like

Hey Taran n All,

@jeremy @pierreguillou

I’m using windows 10 and installed anaconda with python 3.7.
All steps of this documents executed successfully for me. When I entered this last command
“python -m fastai.utils.show_install”
I got an error suggesting DLL load failed. Please find screenshot of same as below:

Can anyone help me here?

Thanks,
Paurav Joshi

Good morning @Paurav.
Did you check all the solutions already published about the subject “fastai importError: DLL load failed” in Google?

Thanks for reply @pierreguillou.
I didn’t face any error in any installation as per your medium article. When I fire command to check version of installations only at that time got the error.
Googled the error but seems everyone has problems with pytorch and honestly m unable to figure out issue is in which module for me, seems Image.py but not sure.

Can you guide me if any thread on that available? Has anyone following your article faced similar prob?

Thanks,
Paurav

Sorry, but I did not face this problem. Hope you can find no Google an answer or here no forum.

Thanks @pierreguillou for trying to search.

@jeremy
One observations:

When I install it with command below:
conda install fastai pytorch=1.0.0 -c fastai -c pytorch -c conda-forge
I get a warning like below:

while I get pytorch installed as I can see from

(fastai_v1) C:\Windows\System32>pip list

Package Version


asn1crypto 1.2.0
attrs 19.3.0
backcall 0.1.0
beautifulsoup4 4.8.1
bleach 3.1.0
blis 0.2.4
Bottleneck 1.2.1
certifi 2019.9.11
cffi 1.13.0
chardet 3.0.4
colorama 0.4.1
cryptography 2.7
cycler 0.10.0
cymem 2.0.2
dataclasses 0.6
decorator 4.4.0
defusedxml 0.6.0
entrypoints 0.3
fastai 1.0.58
fastprogress 0.1.21
idna 2.8
importlib-metadata 0.23
ipykernel 5.1.2
ipython 7.8.0
ipython-genutils 0.2.0
ipywidgets 7.5.1
jedi 0.15.1
Jinja2 2.10.3
jsonschema 3.1.1
jupyter-client 5.3.4
jupyter-core 4.6.0
kiwisolver 1.1.0
MarkupSafe 1.1.1
matplotlib 3.1.1
mistune 0.8.4
mkl-service 2.3.0
more-itertools 7.2.0
murmurhash 1.0.0
nb-conda-kernels 2.2.2
nbconvert 5.6.0
nbformat 4.4.0
notebook 6.0.1
numexpr 2.7.0
numpy 1.15.4
olefile 0.46
packaging 19.2
pandas 0.25.2
pandocfilters 1.4.2
parso 0.5.1
pickleshare 0.7.5
Pillow 6.2.0
pip 19.2.3
plac 0.9.6
preshed 2.0.1
prometheus-client 0.7.1
prompt-toolkit 2.0.10
pycparser 2.19
Pygments 2.4.2
pyOpenSSL 19.0.0
pyparsing 2.4.2
PyQt5 5.12.3
PyQt5-sip 4.19.18
PyQtWebEngine 5.12.1
pyrsistent 0.15.4
PySocks 1.7.1
python-dateutil 2.8.0
pytz 2019.3
pywin32 223
pywinpty 0.5.5
PyYAML 5.1.2
pyzmq 18.1.0
requests 2.22.0
scipy 1.3.1
Send2Trash 1.5.0
setuptools 41.4.0
six 1.12.0
soupsieve 1.9.4
spacy 2.1.8
srsly 0.1.0
terminado 0.8.2
testpath 0.4.2
thinc 7.0.8
torch 1.0.0
torchvision 0.2.2
tornado 6.0.3
tqdm 4.36.1
traitlets 4.3.3
urllib3 1.25.6
wasabi 0.2.2
wcwidth 0.1.7
webencodings 0.5.1
wheel 0.33.6
widgetsnbextension 3.5.1
win-inet-pton 1.1.0
wincertstore 0.2
zipp 0.6.0

I want to understand that why below command is not working and Jupyter also m getting error while executing fast.ai library:
python - m fastai.utils.show_install

Thanks,
Paurav Joshi

I don’t know if windows is struggling with the drivers or is just a lot slower when using GPU for compute. However, I can confirm win 10 is using CUDA during the training on my machine. The torch.cuda.get_device_name and other methods all return my GTX1050ti.

I am attaching a screen shot to show that CUDA is indeed almost fully saturated. That doesn’t explain the performance, or lack there of, to be sure… but at least we know the GPU is being used (albeit, slowly).

1 Like

After setting up jupyter notebook using pip i ran into error while importing the following modules

from fastai.imports import *
from fastai.structured import *

from pandas_summary import DataFrameSummary
from sklearn.ensemble import RandomForestRegressor, RandomForestClassifier
from IPython.display import display

from sklearn import metrics

these are the errors raised. how can i solve this

ImportError Traceback (most recent call last)
in
----> 1 from fastai.imports import *
2 from fastai.structured import *
3
4 from pandas_summary import DataFrameSummary
5 from sklearn.ensemble import RandomForestRegressor, RandomForestClassifier

c:\users\xyx\appdata\local\programs\python\python36\lib\site-packages\fastai\imports_init_.py in
1 from .core import *
----> 2 from .torch import *

c:\users\xyx\appdata\local\programs\python\python36\lib\site-packages\fastai\imports\torch.py in
----> 1 import torch, torch.nn.functional as F
2 from torch import ByteTensor, DoubleTensor, FloatTensor, HalfTensor, LongTensor, ShortTensor, Tensor
3 from torch import nn, optim, as_tensor
4 from torch.utils.data import BatchSampler, DataLoader, Dataset, Sampler, TensorDataset
5 from torch.nn.utils import weight_norm, spectral_norm

c:\users\xyx\appdata\local\programs\python\python36\lib\site-packages\torch_init_.py in
79 del _dl_flags
80
—> 81 from torch._C import *
82
83 all += [name for name in dir(_C)

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

This is what it looks like to me… I’m dual booting and I wanted to try to have fastai on Windows so I can play with Excel when I needed but it takes much more time to compute.

It was very easy for me to install the recent version fastai-1.0.61 on a Windows computer and run the notebooks from the “example” folder. Very nice. I like your approach to make coding available to everyone as quickly and easily as possible.

But I would really have like to work also with the notebooks from the “course” folder. Unfortunately, these require fastai-0.7 and after some research here and there I found that lots of people are struggeling with getting this older fastai-0.7 installed and running. I really find this frustrating, because drifting deeper and deeper in installation routines is exaclty what I don´t like. So sad that the notebooks in the “course” folder don’t work and are useless for me… :frowning_face: