Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can i do train grayscale-imageset? #104

Open
edwardcho opened this issue Mar 3, 2022 · 0 comments
Open

Can i do train grayscale-imageset? #104

edwardcho opened this issue Mar 3, 2022 · 0 comments

Comments

@edwardcho
Copy link

Hello Sir,

I want to train using my-datasets (grayscale).
After change input_dim_a, input_dim_b = 1, I tried to it.

I met some errors.

Traceback (most recent call last):
  File "train.py", line 65, in <module>
    trainer.dis_update(images_a, images_b, config)
  File "/data1/TESTBOARD/additional_networks/generation/MUNIT_NVlabs/trainer.py", line 152, in dis_update
    c_a, _ = self.gen_a.encode(x_a)
  File "/data1/TESTBOARD/additional_networks/generation/MUNIT_NVlabs/networks.py", line 119, in encode
    style_fake = self.enc_style(images)
  File "/home/itsme/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
    return forward_call(*input, **kwargs)
  File "/data1/TESTBOARD/additional_networks/generation/MUNIT_NVlabs/networks.py", line 204, in forward
    return self.model(x)
  File "/home/itsme/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/itsme/anaconda3/lib/python3.7/site-packages/torch/nn/modules/container.py", line 139, in forward
    input = module(input)
  File "/home/itsme/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
    return forward_call(*input, **kwargs)
  File "/data1/TESTBOARD/additional_networks/generation/MUNIT_NVlabs/networks.py", line 342, in forward
    x = self.conv(self.pad(x))
  File "/home/itsme/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/itsme/anaconda3/lib/python3.7/site-packages/torch/nn/modules/conv.py", line 443, in forward
    return self._conv_forward(input, self.weight, self.bias)
  File "/home/itsme/anaconda3/lib/python3.7/site-packages/torch/nn/modules/conv.py", line 440, in _conv_forward
    self.padding, self.dilation, self.groups)
RuntimeError: Given groups=1, weight of size [64, 1, 7, 7], expected input[1, 3, 262, 262] to have 1 channels, but got 3 channels instead

I checked my datasets several times. My dataset is all grayscale (1ch.)

How to train it?

Thanks,
Edward Cho.

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

No branches or pull requests

1 participant