Hi everyone,
After the first two lessons of fastai, I thought of trying out the library on an emotion-reco dataset. I’ve trained the model but I’m facing issues evaluating it on the test data. The test data is in a folder called ‘test_img’ and the labels are given in a csv file called ‘test_labels.csv’
So I have:
test_df = pd.read_csv(‘test_img/test_labels.csv’, header=None)
test_df.head()
0 | 1 | |
---|---|---|
0 | Angry_2247.png | 0 |
1 | Disgust_1014.png | 1 |
2 | Disgust_1315.png | 1 |
3 | Angry_388.png | 0 |
4 | Angry_2140.png | 0 |
Then I do:
test_data = ImageDataLoaders.from_df(test_df, ‘test_img’, valid_pct=0)
learn2 = load_learner(‘models/resnet18.pkl’) #This is the model i have trained
learn2.validate(dl=test_data)
but validate throws me an error:
TypeError: object of type ‘DataLoaders’ has no len()
Is this the right way to load a test set from a csv file? I think i’m missing something.