Fastai v0.7 install issues thread

@draz its for CPU but will make it GPU as well.

Hello FastAI friends,

I think that I am at the very right topic to get helped on my problem. I am trying to create a docker on Ubuntu for fastai-cpu v0.7. I have created the following Dockerfile:

FROM ubuntu:18.04
ENV PYTHON_VERSION=3.6

WORKDIR /fastaidir

ENV TINI_VERSION v0.18.0

ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
ADD https://github.com/etheld/kubevaultenv/releases/download/0.1.12/kubevaultenv-linux-amd64 /vaultenv

RUN apt-get update && \
    apt-get install -y git wget curl unzip libsm6 libxrender1 && \
    curl -o ~/miniconda.sh -O  https://repo.continuum.io/miniconda/Miniconda3-4.5.11-Linux-x86_64.sh  && \
    chmod +x ~/miniconda.sh && \
    ~/miniconda.sh -b -p /opt/conda && \
    rm ~/miniconda.sh && \
    /opt/conda/bin/conda install conda-build && \
    git clone https://github.com/fastai/fastai.git && \
    cd /fastaidir/fastai && ls && /opt/conda/bin/conda env create -f environment-cpu.yml -n fastai-cpu && \
    /opt/conda/bin/conda clean -ya && \
    chmod +x /tini && \
    chmod +x /vaultenv && \
    ln -s /data /fastaidir/data

ADD config_fastai_cpu.sh /
ENV USER fastai

ENTRYPOINT ["/tini", "--"]
CMD ["/config_fastai_cpu.sh”]

, where at the end I am configuring the fastai-cpu with the config_fastai_cpu.sh, inspired from Jeremy at the beginning of this thread:

#!/bin/bash

source /opt/conda/etc/profile.d/conda.sh
conda activate fastai-cpu

pip uninstall -y matplotlib  ;
python -m pip install --upgrade pip  ;
pip install matplotlib  ;
pip install fastai==0.7.0  ;
pip install torchtext==0.2.3  ;
pip install flask==1.0.2    ;

exec /opt/conda/envs/fastai-cpu/bin/python -c 'from fastai.conv_learner import *; print("\nimported \n")'
printf "%*s\n" $ColumnsN |tr " " “_”

This was a working code about a year ago. I bet it’s something about the versions of torch, (or Ubuntu?, or Miniconda?), and at the very end I am getting this error:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/opt/conda/envs/fastai-cpu/lib/python3.6/site-packages/fastai/conv_learner.py", line 1, in <module>
    from .core import *
  File "/opt/conda/envs/fastai-cpu/lib/python3.6/site-packages/fastai/core.py", line 2, in <module>
    from .torch_imports import *
  File "/opt/conda/envs/fastai-cpu/lib/python3.6/site-packages/fastai/torch_imports.py", line 2, in <module>
    import torch, torchvision, torchtext
  File "/opt/conda/envs/fastai-cpu/lib/python3.6/site-packages/torch/__init__.py", line 56, in <module>
    from torch._C import *
ImportError: libcudart.so.8.0: cannot open shared object file: No such file or directory

I don’t understand what I am missing. Please suggest. Thanks!

OMG it works!
I spent hours trying to follow the various install documents. Please do this document in just one place, and replace all the other awful ones. No greater barrier to a software community than an impossible setup.
Thanks…

I wrote a document on How to Install Fastai v0.7 on AWS for Fastai Machine Learning Course that details every installation step to get you started on the Fastai ML course. I agree with @banksiaboy that there is no greater barrier to software development and learning than an impossible setup.

@minh I think that the step 3 is not correct. By doing git clone https://github.com/fastai/fastai.git it basically installs v1.x, not v0.7.

1 Like

I tried and got fasai v0.7 installed correctly. Did you somehow get v1 installed?

On a brand new system (created with Docker) v1 is installed in this way. Moreover, the instructions in https://github.com/fastai/fastai/tree/master/old describe exactly what I am saying.

I have installed latest fastai version. But i am not able to run the ML course. How can i access 0.7version now. Does all the functions of 0.7 version is present in current version?

@DebabrataRoy The latest version is different from the v0.7. You should follow the instructions in https://github.com/fastai/fastai/tree/master/old that refer to the old version (v0.7).

Hello guys, I’m a noob trying out random forest algorithm. I have a little prediction I have made. Please can anyone look into my code and tell me if it makes sense or not. https://github.com/mamman1010/How-much-does-it-rain

Sadly I do not see a torch 0.3.1 for windows anymore!

Is there any way we could install fastai v0.7 on Google Colab and progress with the course using Goolge Colab only? Any other options are paid and I do not have a local machine with GPU on it.

try
!pip install scikit-learn==0.21.3
!pip install fastai==0.7.0

Could any of you guys please kindly help me in installing fastai into my local mission-CPU.
while running below code, I’m getting following error:
##code: from fastai.vision import
*** error**: module ‘torch.jit’ has no attribute ‘unused’

I tried these steps to create an environment for introduction to ml course but not able to do so.
I have python3.8+ version ubuntu20. What am I doing wrong?

I get the following error
ModuleNotFoundError: No module named 'tools.nnwrap'

1 Like

This works fine for me. I add another line, which fixes sklearn import error as referenced by the official commit to old/fastai (0.7.0) directory. The complete would be:

!pip install torchvision==0.1.9
!pip install torchtext==0.2.3
!pip install fastai==0.7.0

!sed --in-place '4 c\
from sklearn.preprocessing import LabelEncoder, StandardScaler;from sklearn.impute._base import SimpleImputer as Imputer' /usr/local/lib/python3.6/dist-packages/fastai/structured.py

It’s not a good idea to make previous versions absolutely incompatible with newer versions.

can we get fastai 0.7v in paperspace? For doing machine learning course

I am new to fastai and I am working on windows. While I was running the first lesson on my jupyter notebook it is showing an error “No module named fastai.imports”

I tried many things but it didn’t workout. Can anyone please help me to sort it out?

Welcome Vinodh, hmm that’s strange, I’m not seeing any fastai.imports in lesson 1. Are you using an old version of the course? There have been a few revisions over the years. The current fastbook version (fastbook/01_intro.ipynb at master · fastai/fastbook · GitHub) has these lines at the top, with the last line in a separate cell:

!pip install -Uqq fastbook
import fastbook
fastbook.setup_book()
from fastbook import *

If you run those lines first, it should have no problem finding fastai.imports after that.