Error No module names fastai.conv_learner

I am using colab and trying to run the following code

from fastai.conv_learner import *
from fastai.dataset import *

and I get the error :
No module named fastai.conv_learner!

It looks like conv_learner is only available in the old version of fastai:

So either install that or use something from here: fastai2/learner.py at master · fastai/fastai2 · GitHub
like the cnn_learner. It can be imported with from fastai.vision.all import *

1 Like

also alot of code in Kaggle is old version!
something like

from fastai.callbacks import * 

it is really annoying for a beginner look for useful resources !

I am also using colab and trying to install old version:

I am using colab and found that I need to install as follows:
!pip install fastai==0.7.0 --no-deps
!pip install torch==0.4.1 torchvision==0.2.1

from fastai.conv_learner import *
from fastai.dataset import *

getting the following error:

File “/usr/local/lib/python3.7/dist-packages/IPython/core/interactiveshell.py”, line 3326, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)

File “”, line 2, in
from fastai.conv_learner import *

File “/usr/local/lib/python3.7/dist-packages/fastai/conv_learner.py”, line 1, in
from .core import *

File “/usr/local/lib/python3.7/dist-packages/fastai/core.py”, line 31
if cuda: a = to_gpu(a, async=True)
^
SyntaxError: invalid syntax