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

Error when starting training #12

Closed
ghost opened this issue Apr 24, 2019 · 0 comments
Closed

Error when starting training #12

ghost opened this issue Apr 24, 2019 · 0 comments

Comments

@ghost
Copy link

ghost commented Apr 24, 2019

I've been struggling too much days with this error, maybe it's really simple but i can't figure out the reason yet. The error is the following:

Traceback (most recent call last):
File "main.py", line 205, in
main(parse_arguments(sys.argv[1:]))
File "main.py", line 169, in main
src_train_dataloader, tgt_train_dataloader, optimizer, epoch)
File "/Volumes/Elements/DANN/pytorch_DANN-master/train/train.py", line 36, in train
for batch_idx, (sdata, tdata) in enumerate(zip(source_dataloader, target_dataloader)):
File "/Volumes/Elements/Apps/anaconda3/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 615, in next
batch = self.collate_fn([self.dataset[i] for i in indices])
File "/Volumes/Elements/Apps/anaconda3/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 615, in
batch = self.collate_fn([self.dataset[i] for i in indices])
File "/Volumes/Elements/Apps/anaconda3/lib/python3.7/site-packages/torchvision/datasets/mnist.py", line 95, in getitem
img = self.transform(img)
File "/Volumes/Elements/Apps/anaconda3/lib/python3.7/site-packages/torchvision/transforms/transforms.py", line 60, in call
img = t(img)
File "/Volumes/Elements/Apps/anaconda3/lib/python3.7/site-packages/torchvision/transforms/transforms.py", line 163, in call
return F.normalize(tensor, self.mean, self.std, self.inplace)
File "/Volumes/Elements/Apps/anaconda3/lib/python3.7/site-packages/torchvision/transforms/functional.py", line 208, in normalize
tensor.sub_(mean[:, None, None]).div_(std[:, None, None])
IndexError: too many indices for tensor of dimension 0

I'd appreciate a lot your help.

@ghost ghost closed this as completed Apr 24, 2019
This issue was closed.
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

0 participants