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

File path seems to be correct why is this happening #5

Open
Venkat1abhinav opened this issue Aug 1, 2024 · 3 comments
Open

File path seems to be correct why is this happening #5

Venkat1abhinav opened this issue Aug 1, 2024 · 3 comments

Comments

@Venkat1abhinav
Copy link

Built the model successfully! Traceback (most recent call last): File "/home/abhi/Land-Cover-Semantic-Segmentation-PyTorch-main/src/train.py", line 173, in <module> raise e File "/home/abhi/Land-Cover-Semantic-Segmentation-PyTorch-main/src/train.py", line 167, in <module> train_loader = DataLoader(train_dataset, batch_size=batch_size, shuffle=True) File "/home/abhi/.conda/envs/python-ml/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 351, in __init__ sampler = RandomSampler(dataset, generator=generator) # type: ignore[arg-type] File "/home/abhi/.conda/envs/python-ml/lib/python3.9/site-packages/torch/utils/data/sampler.py", line 107, in __init__ raise ValueError("num_samples should be a positive integer " ValueError: num_samples should be a positive integer value, but got num_samples=0

@Venkat1abhinav
Copy link
Author

file path seems to be nice why is this still happening

@souvikmajumder26
Copy link
Owner

souvikmajumder26 commented Sep 25, 2024

If you check the logs, there should be "Failed to initialize training and validation datasets and dataloaders!" at the last, which indicates there indeed is some issue with the train and test data path specifically.
The end part of the above error you pasted also denotes "num_samples=0" which means even if the data path is correct, there just might not be any images/files inside the train and test data folders.

Did you run this with your own dataset or the sample one I've provided in the repo as an example? If you're getting this error for your own dataset, can you please check once if it runs fine without making any changes to a freshly cloned project?

@Venkat1abhinav
Copy link
Author

thanks turns out it was a small mistake by my parts but small question why is it talking more time to divide patches for me (7053/7053) patches for you it was just (144/144) why is that ?

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