Virtual-Try-On-Flask
Virtual-Try-On-Flask copied to clipboard
RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 0. Got 256
RuntimeError Traceback (most recent call last)
C:\Users\Desktop\Virtual-Try-On-Flask-master\Model.py in predict(self, human_img, c_img, need_pre, need_bright, keep_back, need_dilate, check_dirty) 87 (-(16-9))+np.array(parse == 17, dtype='uint8')*(-(17-9)) 88 parse = np.array(parse[:, :, 0], dtype="uint8") ---> 89 (out, warp) = self.cpvton.predict(parse, pose_map, human_img, c_img) 90 91 out_img = np.array((np.transpose(out.detach().cpu().numpy()[
C:\Users\Desktop\Virtual-Try-On-Flask-master\CPVTON.py in predict(self, parse_array, pose_map, human, c) 75 im_h = im * phead - (1 - phead) 76 ---> 77 agnostic = torch.cat([shape, im_h, pose_map], 0) 78 79 if self.use_cuda:
RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 0. Got 256 and 253 in dimension 1 at C:\w\1\s\tmp_conda_3.7_021303\conda\conda-bld\pytorch_1565316900252\work\aten\src\TH/generic/THTensor.cpp:689
check your torch and torchvision version
import torch print(torch.version) 1.2.0 import torchvision print(torchvision.version) 0.2.0
can you please specify the pillow,opencv and numpy version
I got the Same error
`---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
1 frames /content/Model.py in predict(self, human_img, c_img, need_pre, need_bright, keep_back, need_dilate, check_dirty) 80 (-(16-9))+np.array(parse == 17, dtype='uint8')*(-(17-9)) 81 parse = np.array(parse[:, :, 0], dtype="uint8") ---> 82 (out, warp) = self.cpvton.predict(parse, pose_map, human_img, c_img) 83 84 out_img = np.array((np.transpose(out.detach().cpu().numpy()[
/content/CPVTON.py in predict(self, parse_array, pose_map, human, c) 68 im_h = im * phead - (1 - phead) 69 ---> 70 agnostic = torch.cat([shape, im_h, pose_map], 0) 71 72 if self.use_cuda:
RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 1. Got 1 and 3 in dimension 0 at /pytorch/aten/src/TH/generic/THTensor.cpp:689`
and the version of torch and torchvision are the same as you have mentioned in the README file.