robelh
(robel)
June 15, 2021, 7:44pm
1
I was testing some code from Kaggle. this is the link of the project on kaggle and i am stack at one point which gives me an error ‘NameError: name ‘ImageList’ is not defined’ when i tried to set argument ImageList into a class just like below.
class MyImageItemList(ImageList):
pass
i.e. i am using fastai 2.3.1
Conwyn
June 15, 2021, 8:41pm
2
Hi Robel
Silly questions first. Did you import vision?
Regards Conwyn
robelh
(robel)
June 15, 2021, 8:55pm
3
Yes i did. Just like this one below
from fastai.vision import *
msivanes
(Manikandan Sivanesan)
June 15, 2021, 9:49pm
4
ImageList is not used anymore. It is part of fastai v1. For fastai v2, you may want to use ImageDataLoaders.from_df instead.
robelh
(robel)
June 16, 2021, 12:44pm
5
well, now it is working with ‘ImageDataLoaders’ but i am facing another issue next to it.
NameError: name ‘PathOrStr’ is not defined.
class MyImageItemList(ImageDataLoaders):
def open(self, fn:PathOrStr )->Image:
pass
the code that i am checking out from can be found here
msivanes
(Manikandan Sivanesan)
June 17, 2021, 2:16am
6
Looking at the kaggle code there seems to be two options 1. Install fastai 1.0.61 and run the code 2. Port the code to fastaiv2 .