Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'DataLoader' is not defined #6

Open
Hnd7 opened this issue Dec 5, 2023 · 1 comment
Open

'DataLoader' is not defined #6

Hnd7 opened this issue Dec 5, 2023 · 1 comment

Comments

@Hnd7
Copy link

Hnd7 commented Dec 5, 2023

Hi, when I am trying to start the training I am getting the following error:

NameError                                 Traceback (most recent call last)
/tmp/ipykernel_21140/3294596851.py in <module>
     14 val_dataset = SemanticSegmentationDataset(val_img_path, val_mask_path)
     15 
---> 16 train_loader = DataLoader(train_dataset, batch_size=2)
     17 val_loader = DataLoader(val_dataset, batch_size=2)
     18 

NameError: name 'DataLoader' is not defined

Do you have any suggestions to how to solve it?

Thanks!

@AlexLee1235
Copy link

I think you can use
from torch.utils.data import Dataset, DataLoader

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants