That’s because the Dataset class doesn’t contain any implementation for size(). Do you need the size of the entire dataset as in [total_len, C, H, W] or are you simply trying to get the size() of the returned value?