Problem to use fastai2 in the Google Colab

hi all,
I have tried to use the fastai2 in the google colab by performing the following commands:

!pip install fastai2

from fastai2.text.all import *

But, the colab presents the error described below, Could you help me?

RuntimeError: tensor.H is only supported on matrices (2-D tensors). Got 1-D tensor.

You should use pip install fastai, not pip install fastai2.

1 Like

Also colab now comes with the latest version of fastai so you shouldn’t need to install anything (2.7.7 now)

2 Likes

Thank you @jeremy.

Thank you @muellerzr.

Hi, @baldoino does this work for you? I’ve tried using pip install fastai, but it didn’t work, and I still ended up getting the “tensor.H is only supported on matrices (2-D tensors). Got 1-D tensor” error in Google Colab.

@jeremy @muellerzr I want to get started in Deep Learning, but I keep running into this same problem that I listed above when i try to import fastai2.vision.all. Can u please tell me how to fix the error? Thanks.

Hi Aashrith
The post above says Colab comes installed with FASTAI. Try not installing it and see if it works.
Regards Conwyn

Hi Conwyn,

I tried what you said, but it only worked for fastai.vision.all, but it didn’t work for fastai2.vision.all (it said no module called fastai2). Does it matter at all which version of fastai i use? Or will I not be able to run some of the programs jeremy goes over in his course, as he uses fastai2.vision.all.

Thanks,
Aashrith

1 Like

Hi Aashrith

Why so you think you should be using fastai2.vision,all. In which video does Jeremy say to use fastai2?

I have watched all the videos since 2017 and I can not recall when. V2 replaced V1 but it was quite a while ago.

Regards Conwyn

Hi

I found this from December 2022

The docs are now at https://docs.fast.ai/ , as fastai-v2 has been released, superseding fastai-v1.

Regards Conwyn

Hi Conwyn,

In the video where Jeremy goes over the entire fastai course associated with Freecodecamp, he uses fastai2, and some of my code didn’t work with fastai.vision.all.

Also, the docs for google colab didn’t work again, as it says that there is no module named fastai2. I’ve tried basically everything to install fastai2, but nothing seems to work.

Thanks for your help,
Conwyn.

Hi Aashirth
There is no requirement to use fastai2. Please use Google Colab as provided. The fastai provided is the latest production version.
What exactly did not work with fastai.vision.all?
Regards Conwyn