Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fastai applications import error: No module named 'fastai.learner' #1

Open
edtky opened this issue Oct 9, 2018 · 9 comments
Open

Comments

@edtky
Copy link

edtky commented Oct 9, 2018

I get the error "No module named fastai.learner" when I run:

!python generate.py -model notewise_generator -output notewise_generator_samples --random_freq .8 --trunc 3

in BasicIntro.ipynb.

The error occurs for all the fastai applications that you import:
from fastai.learner import *
from fastai.rnn_reg import *
from fastai.rnn_train import *
from fastai.nlp import *
from fastai.lm_rnn import *

Also the way fastai structure their modules (http://docs.fast.ai/index.html) seem to be different from what is used in this repo.

@MathiasBryggerHansen
Copy link

What (s)he said.

@Ddedalous
Copy link

any fix?

@Ddedalous
Copy link

Ddedalous commented May 16, 2019

use the conda environment in the original notebook. then import the environment into your project then it works perfectly

@StevenGin
Copy link

use the conda environment in the original notebook. then import the environment into your project then it works perfectly

Can you clarify on how you did this? It seems that this code was built using an older version of fastai. I tried using 0.7 but am running into issues.

@rickchen147258
Copy link

rickchen147258 commented Jun 8, 2019

@StevenGin
I found that you need to do "ln -s ~/fastai/old/fastai fastai" instead of "ln -s ~/fastai fastai".
Because this lab uses the old version fastai.
This works for me.

@duhaime
Copy link

duhaime commented Jun 11, 2020

The last commit to this repo was ~2 years ago, so if one checks fastai's repo, one finds a release from 2 years ago 0.70.0 that has fastai.learner. Some subsequent prodding around suggests you can use the following:

pip install fastai==0.7.0
pip install torch==1.3.0
pip install torchtext==0.3.1
pip install torchvision==0.4.1
pip install dill==0.3.1.1

Then if you have a Cuda chip attached to your host (the pretrained models were created on Cuda chips) you can:

python generate.py -model notewise_generator -output notewise_generator_samples --random_freq .8 --trunc 3

@ForgetfulJoy
Copy link

I found the following versions work for me:
! pip install fastai==0.7
! pip install torch==0.3.1
! pip install torchvision==0.2.2
! pip install Pillow==6.2.2
! pip install pyknon
! pip install torchtext==0.2.3

@vastav06
Copy link

I used these steps, and error got resolved for me:

Open terminal

Navigate to anaconda3
cd anaconda3

update conda
conda update conda

Navigate to conda env section and create new environment named fastai
cd envs
conda create --name fastai

make fastai environment as current working directory
cd fastai

clone github repository of course-v3
git clone https://github.com/fastai/course-v3.git

make course-v3 as current working dir
cd course-v3

open jupyter notebook
jupyter notebook

Click New->Terminal in Jupyter, then type:
conda install -c fastai fastai
this step will install all required libraries.

@ForgetfulJoy
Copy link

ForgetfulJoy commented Aug 28, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants