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: view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead. #12

Open joseflorezc opened 3 years ago

joseflorezc commented 3 years ago

Hello!

im trying to run the project but this error appears when trying to run networks.py, in the function:

def forward(self, x): x = self.conv(x) x = x.view(x.size(0), -1) <- in this specific part x = self.linear(x) x = self.tanh(x) return x

any suggestions?

slin98269 commented 5 months ago

try this: x = x.contigous().view(x.size(0), -1)