banikr:

Is there a better way to check that correct data are sent to the model, apart from the tensor shape?


You could create pre-defined tensors as the input to the Dataset and verify the values in the training loop.
E.g. create 10 samples, where each image contains a specific scalar value (you could use torch.arange, unsqueeze the needed dimensions, and expand the tensor). Before passing the chunks to the model, print the data and make sure the samples look correct and are not e.g. interleaved.



 banikr:

Just out of curiosity, are there Pytorch functionality for that? Some of the posts I have seen has words like Torchnet, ConcatDataset, ChunkSize and things like that?


Torchnet was a higher-level API for Torch7 (LuaTorch), if I’m not mistaken. ConcatDataset is used to concatenate different datasets to a single one (which wouldn’t help here), and I don’t know what ChunkSize refers to.
That being said, I don’t think this functionality is added to PyTorch core modules, but might be available in a high-level API, such as Ignite, Lightning, or Catalyst.