I have a lot of images data and I am trying to pack 8 images with 1 label interactively. After that, I will feed the data into the neural network accordingly. But I’m unable to extract the images from my customized Dataset(). Here is my code below

image.png930×685 28.7 KB

my file path looks like this:
…\O2Hb_1.png
…\O2Hb_2.png
…\O2Hb_3.png
…\O2Hb_4.png
…\O2Hb_5.png
…\O2Hb_6.png
…\O2Hb_7.png
…\O2Hb_8.png
0
the last line 0 is the label
and is there any way to put 8 images into 1 tensor with 1 label, and then feed into CNN?
I’m new to Pytorch and really need some help, thanks!