Skip to content
This repository has been archived by the owner on Feb 14, 2024. It is now read-only.

How to change the number of channels from 3 to 1 #55

Open
avinash2022skipq opened this issue Dec 20, 2022 · 0 comments
Open

How to change the number of channels from 3 to 1 #55

avinash2022skipq opened this issue Dec 20, 2022 · 0 comments

Comments

@avinash2022skipq
Copy link

avinash2022skipq commented Dec 20, 2022

Hello, thank you for the code. I trained the model on my on dataset of FONTS which are black and white means the channel is 1, so now where can I set the channel size also can I use same vgg encoder or I have to change the encoder according to my channel size because while training on the images I didn't get the error but while the testing on I got the error I am using the decoder after training from experiments.

(test1) D:\Coding\AdaIN_Code\AdaIN_exp1>python test.py --content_dir input/content4 --style_dir input/style4
Traceback (most recent call last):
File "D:\Coding\AdaIN_Code\AdaIN_exp1\test.py", line 155, in
output = style_transfer(vgg, decoder, content, style,
File "D:\Coding\AdaIN_Code\AdaIN_exp1\test.py", line 28, in style_transfer
content_f = vgg(content)
File "C:\Users\ak874\anaconda3\envs\test1\lib\site-packages\torch\nn\modules\module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "C:\Users\ak874\anaconda3\envs\test1\lib\site-packages\torch\nn\modules\container.py", line 139, in forward
input = module(input)
File "C:\Users\ak874\anaconda3\envs\test1\lib\site-packages\torch\nn\modules\module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "C:\Users\ak874\anaconda3\envs\test1\lib\site-packages\torch\nn\modules\conv.py", line 457, in forward
return self._conv_forward(input, self.weight, self.bias)
File "C:\Users\ak874\anaconda3\envs\test1\lib\site-packages\torch\nn\modules\conv.py", line 453, in _conv_forward
return F.conv2d(input, weight, bias, self.stride,
RuntimeError: Given groups=1, weight of size [3, 3, 1, 1], expected input[1, 1, 128, 128] to have 3 channels, but got 1 channels instead

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant