Not able to load image data for validation dataset

I am trying to load data for both training set and validation set. Training set data loads without any isues, but validation does not load and has some issues, i have given below the code and error message.

Please help.

Code:

np.random.seed(41)
data = ImageDataBunch.from_folder(path, train=“trainingset”, valid =“kanna”,
ds_tfms=get_transforms(), size=(256,256), bs=32, num_workers=4).normalize()

Error:

C:…\Anaconda3\lib\site-packages\fastai\data_block.py:541: UserWarning: You are labelling your items with CategoryList.
Your valid set contained the following unknown labels, the corresponding items have been discarded.
training
if getattr(ds, ‘warn’, False): warn(ds.warn)

As suggested by Sylvain :wink: it is a lot more helpful to provide both whole code and whole setup.

Thanks for your response.

Are you saying that it is a bug? If this function is having some bug, can i use any other function to load my image dataset ?

code:

%reload_ext autoreload
%autoreload 2
%matplotlib inline
import os

from fastai.vision import *

path =“c>…”

These are the codes which i have written before the codes i have put up in the forum

You should totally use the DataBlock API from fastai2.
Here a very detailed tutorial.

Thanks for your reply.

That is just a warning message and my code is running fine.

Hi,

my cnn network ran epochs and did wrong prediction. Now i am able to figure out what’s going on but i could not find the solutions.

It looks like my validation dataset is not labelled when i import the data using ImageDataBunch() and the error message is given below.

C:…\Anaconda3\lib\site-packages\fastai\data_block.py:541: UserWarning: You are labelling your items with CategoryList.
Your valid set contained the following unknown labels, the corresponding items have been discarded.
No_findings
if getattr(ds, ‘warn’, False): warn(ds.warn)