shionhonda / viton-gan

Original implementation of the paper "VITON-GAN: Virtual Try-on Image Generator Trained with Adversarial Loss" by Shion Honda.
https://diglib.eg.org/handle/10.2312/egp20191043
MIT License
101 stars 31 forks source link

RuntimeError: output with shape [1, 256, 192] doesn't match the broadcast shape [3, 256, 192] #8

Open 17sushmita opened 4 years ago

17sushmita commented 4 years ago

Getting this error while running train_gmm.py

Namespace(batch_size=16, data_root='data', fine_height=256, fine_width=192, gpu_id='0', grid_size=5, log_freq=100, n_epoch=100, n_worker=16, name='GMM', out_dir='../result', radius=5) Loading dataset Building GMM model Total Parameters: 19057650 Start training GMM 0% 0/100 [00:00<?, ?it/s]Epoch: 0

epoch: 0: 0% 0/1 [00:00<?, ?it/s] 0% 0/100 [00:00<?, ?it/s] Traceback (most recent call last): File "train_gmm.py", line 140, in main() File "train_gmm.py", line 127, in main loss = trainer.train(epoch) File "train_gmm.py", line 33, in train return self.iteration(epoch, self.dataloader_train) File "train_gmm.py", line 45, in iteration for i, _data in data_iter: File "/usr/local/lib/python3.6/dist-packages/tqdm/std.py", line 1104, in iter for obj in iterable: File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py", line 345, in next data = self._next_data() File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py", line 856, in _next_data return self._process_data(data) File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py", line 881, in _process_data data.reraise() File "/usr/local/lib/python3.6/dist-packages/torch/_utils.py", line 395, in reraise raise self.exc_type(msg) RuntimeError: Caught RuntimeError in DataLoader worker process 0. Original Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/_utils/worker.py", line 178, in _worker_loop data = fetcher.fetch(index) File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/_utils/fetch.py", line 44, in data = [self.dataset[idx] for idx in possibly_batched_index] File "/content/drive/My Drive/viton-gan/viton_gan/dataset.py", line 155, in getitem data = self._get_item_base(index) File "/content/drive/My Drive/viton-gan/viton_gan/dataset.py", line 103, in _get_item_base feature_shape_tensor = self.transform(self._downsample(shapeim)) # [-1,1] File "/usr/local/lib/python3.6/dist-packages/torchvision/transforms/transforms.py", line 61, in call img = t(img) File "/usr/local/lib/python3.6/dist-packages/torchvision/transforms/transforms.py", line 166, in call return F.normalize(tensor, self.mean, self.std, self.inplace) File "/usr/local/lib/python3.6/dist-packages/torchvision/transforms/functional.py", line 208, in normalize tensor.sub(mean).div_(std) RuntimeError: output with shape [1, 256, 192] doesn't match the broadcast shape [3, 256, 192]

epoch: 0: 0% 0/1 [00:00<?, ?it/s]

Naveen-Nanda commented 4 years ago

Has this problem been fixed?

tasinislam21 commented 3 years ago

I had this problem before but on a different repository. I fixed it by using a specific version of PyTorch. Use pytorch 0.4.1 and torchvision 0.2.1