SSARCandy / DeepCORAL

🧠 A PyTorch implementation of 'Deep CORAL: Correlation Alignment for Deep Domain Adaptation.', ECCV 2016
https://ssarcandy.tw/2017/10/31/deep-coral/
226 stars 42 forks source link

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

Open tjzjp opened 5 years ago

tjzjp commented 5 years ago

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'