open-mmlab / mmfashion

Open-source toolbox for visual fashion analysis based on PyTorch
https://open-mmlab.github.io/
Apache License 2.0
1.27k stars 283 forks source link

try and on #128

Open supermy777 opened 3 years ago

supermy777 commented 3 years ago

load checkpoint from: checkpoint/GMM_epoch_40.pth Traceback (most recent call last): File "tools/test_virtual_tryon.py", line 97, in main() File "tools/test_virtual_tryon.py", line 75, in main logger=logger) File "/databank/home/mayuan/anaconda3/lib/python3.7/site-packages/mmfashion-0.4.0-py3.7.egg/mmfashion/apis/test_virtual_tryon.py", line 22, in test_geometric_matching _non_dist_test_gmm(model, dataset, cfg, validate=validate) File "/databank/home/mayuan/anaconda3/lib/python3.7/site-packages/mmfashion-0.4.0-py3.7.egg/mmfashion/apis/test_virtual_tryon.py", line 45, in _non_dist_test_gmm for batch, data in enumerate(data_loader): File "/databank/home/mayuan/anaconda3/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 345, in next data = self._next_data() File "/databank/home/mayuan/anaconda3/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 856, in _next_data return self._process_data(data) File "/databank/home/mayuan/anaconda3/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 881, in _process_data data.reraise() File "/databank/home/mayuan/anaconda3/lib/python3.7/site-packages/torch/_utils.py", line 394, in reraise raise self.exc_type(msg) RuntimeError: Caught RuntimeError in DataLoader worker process 0. Original Traceback (most recent call last): File "/databank/home/mayuan/anaconda3/lib/python3.7/site-packages/torch/utils/data/_utils/worker.py", line 178, in _worker_loop data = fetcher.fetch(index) File "/databank/home/mayuan/anaconda3/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/databank/home/mayuan/anaconda3/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in data = [self.dataset[idx] for idx in possibly_batched_index] File "/databank/home/mayuan/anaconda3/lib/python3.7/site-packages/mmfashion-0.4.0-py3.7.egg/mmfashion/datasets/CP_VTON.py", line 90, in getitem shape = self.transform(parseshape) File "/databank/home/mayuan/anaconda3/lib/python3.7/site-packages/torchvision/transforms/transforms.py", line 70, in call img = t(img) File "/databank/home/mayuan/anaconda3/lib/python3.7/site-packages/torchvision/transforms/transforms.py", line 175, in call return F.normalize(tensor, self.mean, self.std, self.inplace) File "/databank/home/mayuan/anaconda3/lib/python3.7/site-packages/torchvision/transforms/functional.py", line 218, in normalize tensor.sub(mean[:, None, None]).div_(std[:, None, None]) RuntimeError: output with shape [1, 256, 192] doesn't match the broadcast shape [3, 256, 192]

HenryOsborne commented 3 years ago

Modify line 36 of the mmfashion/datasets/CP_VTON.py file

normalize = transforms.Normalize((0.5,), (0.5,))