TFlite model maker train_data.size not working

I want to know the numbers of my training, test, and validation samples after splitting, but I receive this kind of error.

Code: print(‘Number of Training Samples: {}’.format(train_data.size))

" AttributeError : ‘ImageClassifierDataLoader’ object has no attribute ‘size’

Hi Hagen,

The ImageClassifierDataLoader creates a tf.data.Dataset. This structures are lazily evaluated so they don’t load everything to memory until you use them, that’s why they don’t have a size atribute

When you use the from_folder method from the dataloader, it will print how many files it found and will be used later, would that help?

1 Like