Skip to content

Weight input mismatch #20

Description

@artemkurylev

Got this error, while trying to run test_model.py with pretrained weights
RuntimeError: Given groups=1, weight of size [32, 4, 3, 3], expected input[1, 12, 306, 226] to have 4 channels, but got 12 channels instead
Full stack trace

  File "C:/Users/130/Documents/Clofit/Repos/PyNET-PyTorch/test_model.py", line 85, in <module>
    test_model()
  File "C:/Users/130/Documents/Clofit/Repos/PyNET-PyTorch/test_model.py", line 72, in test_model
    enhanced = model(raw_image.detach())
  File "C:\Users\130\Anaconda3\lib\site-packages\torch\nn\modules\module.py", line 550, in __call__
    result = self.forward(*input, **kwargs)
  File "C:\Users\130\Anaconda3\lib\site-packages\torch\nn\parallel\data_parallel.py", line 143, in forward
    return self.module(*inputs, **kwargs)
  File "C:\Users\130\Anaconda3\lib\site-packages\torch\nn\modules\module.py", line 550, in __call__
    result = self.forward(*input, **kwargs)
  File "C:\Users\130\Documents\Clofit\Repos\PyNET-PyTorch\model.py", line 222, in forward
    conv_l1_d1 = self.conv_l1_d1(x)
  File "C:\Users\130\Anaconda3\lib\site-packages\torch\nn\modules\module.py", line 550, in __call__
    result = self.forward(*input, **kwargs)
  File "C:\Users\130\Documents\Clofit\Repos\PyNET-PyTorch\model.py", line 287, in forward
    out_3 = self.conv_3a(x)
  File "C:\Users\130\Anaconda3\lib\site-packages\torch\nn\modules\module.py", line 550, in __call__
    result = self.forward(*input, **kwargs)
  File "C:\Users\130\Documents\Clofit\Repos\PyNET-PyTorch\model.py", line 331, in forward
    out = self.conv2d(out)
  File "C:\Users\130\Anaconda3\lib\site-packages\torch\nn\modules\module.py", line 550, in __call__
    result = self.forward(*input, **kwargs)
  File "C:\Users\130\Anaconda3\lib\site-packages\torch\nn\modules\conv.py", line 349, in forward
    return self._conv_forward(input, self.weight)
  File "C:\Users\130\Anaconda3\lib\site-packages\torch\nn\modules\conv.py", line 346, in _conv_forward
    self.padding, self.dilation, self.groups)```

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions