GithubHelp home page GithubHelp logo

runtimeerror given group=1,weight of size [64,42,1,1],expected input[1,60,64,64] to have 42 channels, but got 60 channels instead about pasta-gan HOT 6 CLOSED

xiezhy6 avatar xiezhy6 commented on September 13, 2024
runtimeerror given group=1,weight of size [64,42,1,1],expected input[1,60,64,64] to have 42 channels, but got 60 channels instead

from pasta-gan.

Comments (6)

Atlas-wuu avatar Atlas-wuu commented on September 13, 2024

i use 'bash train.sh 1' to get a model, and 'bash test.sh 1' to inference. @xiezhy6

Traceback (most recent call last): File "test.py", line 160, in generate_images() # pylint: disable=no-value-for-parameter File "/usr/local/miniconda3/lib/python3.8/site-packages/click/core.py", line 1128, in call return self.main(*args, **kwargs) File "/usr/local/miniconda3/lib/python3.8/site-packages/click/core.py", line 1053, in main rv = self.invoke(ctx) File "/usr/local/miniconda3/lib/python3.8/site-packages/click/core.py", line 1395, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/local/miniconda3/lib/python3.8/site-packages/click/core.py", line 754, in invoke return __callback(*args, **kwargs) File "/usr/local/miniconda3/lib/python3.8/site-packages/click/decorators.py", line 26, in new_func return f(get_current_context(), *args, **kwargs) File "test.py", line 122, in generate_images gen_c, cat_feat_list = G.style_encoding(norm_img_c_tensor, retain_tensor) File "/usr/local/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(*input, **kwargs) File "/data1/codes/PASTA-GAN-main/training/networks.py", line 4880, in forward x = module(x) File "/usr/local/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(*input, **kwargs) File "/data1/codes/PASTA-GAN-main/training/networks.py", line 174, in forward x = conv2d_resample.conv2d_resample(x=x, w=w.to(x.dtype), f=self.resample_filter, up=self.up, down=self.down, padding=self.padding, flip_weight=flip_weight) File "/data1/codes/PASTA-GAN-main/torch_utils/misc.py", line 107, in decorator return fn(*args, **kwargs) File "/data1/codes/PASTA-GAN-main/torch_utils/ops/conv2d_resample.py", line 147, in conv2d_resample return _conv2d_wrapper(x=x, w=w, padding=[py0,px0], groups=groups, flip_weight=flip_weight) File "/data1/codes/PASTA-GAN-main/torch_utils/ops/conv2d_resample.py", line 54, in _conv2d_wrapper return op(x, w, stride=stride, padding=padding, groups=groups) File "/data1/codes/PASTA-GAN-main/torch_utils/ops/conv2d_gradfix.py", line 38, in conv2d return torch.nn.functional.conv2d(input=input, weight=weight, bias=bias, stride=stride, padding=padding, dilation=dilation, groups=groups) RuntimeError: Given groups=1, weight of size [64, 42, 1, 1], expected input[1, 60, 64, 64] to have 42 channels, but got 60 channels instead

solved

from pasta-gan.

romesa-khan avatar romesa-khan commented on September 13, 2024

Hi @wucj123,
Could you please mention how you solved this issue? I am running into the same problem when I load the pre-trained model weights.
Thanks!

from pasta-gan.

Atlas-wuu avatar Atlas-wuu commented on September 13, 2024

Hi @wucj123, Could you please mention how you solved this issue? I am running into the same problem when I load the pre-trained model weights. Thanks!

the train code is for full-body try-on;and test code is for upper-body try-on. so you need to rewrite dataset dataloader for test full-body try-on.

from pasta-gan.

vinodbukya6 avatar vinodbukya6 commented on September 13, 2024

Hi @wucj123
Hope you are doing good. Could you please share your dataset.py (dataloader for full-body try-on) file?
I am working on smaller model (192x256) inference but facing runtime error on expected channels.

from pasta-gan.

Atlas-wuu avatar Atlas-wuu commented on September 13, 2024

Hi @vinodbukya6
i'm sorry. Because of company rules, I can't share the code.
i rewrite UvitonDatasetV19_test module in dataset.py according to UvitonDatasetFull module, especially _load_raw_image function.

from pasta-gan.

vinodbukya6 avatar vinodbukya6 commented on September 13, 2024

Hi @wucj123
Thank you so much for quick response.
I have done changes like you said but not able to solve the issue. For inferencing lower and upper wear clothes did you add these functions normalize_lower and normalize_upper functions from UvitonDatasetFull_512_test class?

norm_img, norm_img_lower, denorm_upper_img, denorm_lower_img = self.normalize_upper(upper_clothes_image, \ lower_person_image, upper_clothes_mask_rgb, lower_person_mask_rgb, clothes_keypoints, \ keypoints, 2)

from pasta-gan.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.