Wrong with dataloader?

Ok. So this looks like a dataset path issue. Can you please tell me what are you passing as input to data_dir ?
Ideally the data_dir = './VOCdevkit/VOC2012/' as per my function.
Also, make sure that the get_dataloader_single_folder function looks something like this:

def get_dataloader_single_folder(data_dir, imageFolder='JPEGImages', maskFolder='SegmentationClass', fraction=0.2, batch_size=4):

Hope this helps.

data_directory=“/content/DeepLabv3FineTuning/dataset1”

exp_directory=“/content/DeepLabv3FineTuning/WL”

bpath = exp_directory

data_dir = data_directory

epochs = 25

batchsize = 1
I passing this way and the images can show


the wrong: # Cannot statically verify that dataset is Sized

So, do you have the following folders at this path /content/DeepLabv3FineTuning/dataset1:
JPEGImages and SegmentationClass ?
Do you have these two folders under the directory at data_directory path ? If yes, then this should work.
Like in my example, this is the directory structure:

./VOCdevkit/
          |_ VOC2012/
                   |_ JPEGImages/[original_images]
                   |_ SegmentationClass/[segmentation_masks]

How does your directory structure look like ? Does it match mine as above ?

I put it this way to match the author’s , and the image can show when I call it38

I remain nothing change and make my folder like the author, just test the definition to ensure the image can read as you guide, but I got the above error.

I change the logic to voc directory and the same thing happens…I am so confusing…

Ok. Can you share a link or post your code somewhere. Looks like you have made some changes in the code like adding a sampler and all as compared to the original GitHub code. So I’ll need to see the code to help you out now.

Ok. Can you provide me the access to see the notebook ? I have requested for access.

https://colab.research.google.com/drive/1_EwHk0aySbhtlUF-lLR69kH2tbCgsTrH?usp=sharing

can you see it successfully? since I did not receive any request

Hi, Yes, I am able to see the notebook from that link. But is it the correct notebook ? I don’t see any sampler in here whereas your error above says there is a RandomSampler. Can you check again ?

yes, I did not add any sampler…it just seems to be something in pytorch dataloader function

This is my dataset1
https://drive.google.com/file/d/1PPQLUFrRUsjXzcmiQeaCLBAFk7LoOdh2/view?usp=sharing

Ok. So I made my proposed changes above to your notebook and was able to train the model on VOC2012 dataset.
I’ll try your dataset now and see if I can replicate your issue and let you know soon.

Thanks so much! I am going to share with you another dataset since I trained the original one on another model successfully and I want to train the new one via this and the same problem also exists.

Why I got this error? my image and label are the same size(166*190 24)
RuntimeError: stack expects each tensor to be equal size, but got [3, 185, 204] at entry 0 and [3, 190, 166] at entry 1

You can clearly see here that your input images are of different sizes. Use the Resize() transform to get them to a common size.

Hello sir, can u help me with this type of same problem? I am using voice, text data for training a model