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

TypeError: unsupported operand type(s) for /: 'tuple' and 'int' #18

Open
tjzjp opened this issue Jun 25, 2019 · 0 comments
Open

TypeError: unsupported operand type(s) for /: 'tuple' and 'int' #18

tjzjp opened this issue Jun 25, 2019 · 0 comments

Comments

@tjzjp
Copy link

tjzjp commented Jun 25, 2019

I'm sorry i met the following error using the office31 dataset

[INFO] Loading datasets: amazon
[INFO] Loading datasets: webcam
Traceback (most recent call last):
File "main.py", line 151, in
res = train(model, optimizer, e+1, _lambda)
File "main.py", line 28, in train
source, target = list(enumerate(source_loader)), list(enumerate(target_loader))
File "/home/zjp/anaconda3/envs/pytorch0.2/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 201, in next
return self._process_next_batch(batch)
File "/home/zjp/anaconda3/envs/pytorch0.2/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 221, in _process_next_batch
raise batch.exc_type(batch.exc_msg)
TypeError: Traceback (most recent call last):
File "/home/zjp/anaconda3/envs/pytorch0.2/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 40, in _worker_loop
samples = collate_fn([dataset[i] for i in batch_indices])
File "/home/zjp/anaconda3/envs/pytorch0.2/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 40, in
samples = collate_fn([dataset[i] for i in batch_indices])
File "/home/zjp/anaconda3/envs/pytorch0.2/lib/python3.6/site-packages/torchvision/datasets/folder.py", line 67, in getitem
img = self.transform(img)
File "/home/zjp/anaconda3/envs/pytorch0.2/lib/python3.6/site-packages/torchvision/transforms.py", line 29, in call
img = t(img)
File "/home/zjp/anaconda3/envs/pytorch0.2/lib/python3.6/site-packages/torchvision/transforms.py", line 139, in call
ow = int(self.size * w / h)
TypeError: unsupported operand type(s) for /: 'tuple' and 'int'

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

1 participant