While reading the fastbook and running kernels, there was no problem (could be because of fastbook import perhaps). But when importing from scratch, tried:
from fastai.vision import *
from fastai.vision.data import *
Colab and local jupyer lab would throw an error.
These 2 from visual tutorials are also not working:
from fastai2.data.all import *
from fastai2.vision.all import *
fastai2 must be outdated, but I still gave it a run.
This is an error:
NameError: name 'DataBlock' is not defined
Please tell, how to import properly.
ps. forums and SO didn’t help.
Hi olegperegudov hope you are having a beautiful day!
in my personal notes I have written the following - run the code below at the beginig of each notebook.
!pip install -Uqq fastbook
import fastbook
fastbook.setup_book() # added as couldn't find untar command below 20201205
I also have this note in my persnal notes book also,./
On colab, you would type: pip install fastai --upgrade and then restart your runtime. Then it should work just fine! # had to do above 20200929 to stop error below (NameError: name ‘ImageDataLoaders’ is not defined)
I haven’t done any further research, It just worked for me and without it, I experience errors, with it my noteboooks work fine on Colab every day!
Theres so much to learn in AI I don’t have the time to understand things, unless I have to.The Fastbook Module contains an attribute for every function that I have seen in fastai such as dataloaders etc. (as of today 996 attributes).
Hope this helps.
Cheers mrfabulous1