RuntimeError: Given groups=1, weight[512, 3, 1, 1, 1], so expected input[32, 1, 6, 4, 4] to have 3 channels, but got 1 channels instead

dhruvsheth-ai: <p>Described Error-</p>
<pre><code class="lang-python">RuntimeError: Given groups=1, weight[512, 3, 1, 1, 1], so expected input[32, 1, 6, 4, 4] to have 3 channels, but got 1 channels instead
</code></pre>
<p>I am aware that this issue type has been raised several times, but none of them helped me solved my issue.<br>
I am trying to Implement a <code>FutureGAN model</code> from here- <a href="https://github.com/TUM-LMF/FutureGAN" class="inline-onebox" rel="noopener nofollow ugc">GitHub - TUM-LMF/FutureGAN: Official PyTorch Implementation of FutureGAN</a></p>
<p>I followed all the steps mentioned in the Description and finally ran -</p>
<pre><code class="lang-auto">python /content/FutureGAN/train.py --data_root='/content/mmnist-2/train'
</code></pre>
<aside class="onebox githubblob" data-onebox-src="https://github.com/TUM-LMF/FutureGAN/blob/master/train.py">
  <header class="source">

      <a href="https://github.com/TUM-LMF/FutureGAN/blob/master/train.py" target="_blank" rel="noopener nofollow ugc">github.com</a>
  </header>

  <article class="onebox-body">
    <h4><a href="https://github.com/TUM-LMF/FutureGAN/blob/master/train.py" target="_blank" rel="noopener nofollow ugc">TUM-LMF/FutureGAN/blob/master/train.py</a></h4>


    <pre><code class="lang-py"># =============================================================================
# Train FutureGAN
# =============================================================================

'''
Script to train FutureGAN.

Your training data is assumed to be arranged in this way:
    data_root/video(n)/frame(m).ext
    n corresponds to number of video folders, m to number of frames in eachfolder.

To resume training from a checkpoint, set the --use_ckpt=`True` and specify --ckpt_path:
    --ckpt_path=`path_to_generator_ckpt` [0]
    --ckpt_path=`path_to_discriminator_ckpt` [1]

For further options and information, read the provided `help` information of the optional arguments below.

-------------------------------------------------------------------------------
This code borrows from:
    https://github.com/nashory/pggan-pytorch
</code></pre>


  This file has been truncated. <a href="https://github.com/TUM-LMF/FutureGAN/blob/master/train.py" target="_blank" rel="noopener nofollow ugc">show original</a>

  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>

<p>This yields an error -</p>
<pre><code class="lang-auto"> ... loading training configuration ... 
 ... saving training configuration to &lt;_io.TextIOWrapper name='./logs/2021-08-24_172412/train_config.txt' mode='w' encoding='UTF-8'&gt;
 ... creating initial models ... 
 ... initial models have been built successfully ... 
 ... saving initial model strutures to &lt;_io.TextIOWrapper name='./logs/2021-08-24_172412/initial_model_structure_4x4.txt' mode='w' encoding='UTF-8'&gt;
  0% 0/10140 [00:00&lt;?, ?it/s]
Traceback (most recent call last):
  File "/content/FutureGAN/train.py", line 832, in &lt;module&gt;
    trainer.train()
  File "/content/FutureGAN/train.py", line 574, in train
    self.z_x_gen = self.G(self.z)
  File "/usr/local/envs/FutureGAN/lib/python3.6/site-packages/torch/nn/modules/module.py", line 357, in __call__
    result = self.forward(*input, **kwargs)
  File "/content/FutureGAN/model.py", line 307, in forward
    y = self.model(x)
  File "/usr/local/envs/FutureGAN/lib/python3.6/site-packages/torch/nn/modules/module.py", line 357, in __call__
    result = self.forward(*input, **kwargs)
  File "/usr/local/envs/FutureGAN/lib/python3.6/site-packages/torch/nn/modules/container.py", line 67, in forward
    input = module(input)
  File "/usr/local/envs/FutureGAN/lib/python3.6/site-packages/torch/nn/modules/module.py", line 357, in __call__
    result = self.forward(*input, **kwargs)
  File "/usr/local/envs/FutureGAN/lib/python3.6/site-packages/torch/nn/modules/container.py", line 67, in forward
    input = module(input)
  File "/usr/local/envs/FutureGAN/lib/python3.6/site-packages/torch/nn/modules/module.py", line 357, in __call__
    result = self.forward(*input, **kwargs)
  File "/content/FutureGAN/custom_layers.py", line 114, in forward
    x = self.conv(x.mul(self.scale))
  File "/usr/local/envs/FutureGAN/lib/python3.6/site-packages/torch/nn/modules/module.py", line 357, in __call__
    result = self.forward(*input, **kwargs)
  File "/usr/local/envs/FutureGAN/lib/python3.6/site-packages/torch/nn/modules/conv.py", line 388, in forward
    self.padding, self.dilation, self.groups)
  File "/usr/local/envs/FutureGAN/lib/python3.6/site-packages/torch/nn/functional.py", line 126, in conv3d
    return f(input, weight, bias)
RuntimeError: Given groups=1, weight[512, 3, 1, 1, 1], so expected input[32, 1, 6, 4, 4] to have 3 channels, but got 1 channels instead
</code></pre>
<p>I could resolve this issue by providing an input of just 1 channel,</p>
<pre><code class="lang-auto">python /content/FutureGAN/train.py --data_root='/content/mmnist-2/train' --nc 1
</code></pre>
<p>but that is not exactly how I wish to solve this. I would want my input to be in the RGB form.</p>
<p>Here are the details of my environment -<br>
I am using a google colab notebook to do the training with all the steps here -<br>
It is a regular Colab environment with Conda installed with  all dependencies.</p>
<pre><code class="lang-auto">https://github.com/dhruvsheth-ai/FutureGAN/blob/master/FutureGAN-new.ipynb
</code></pre>
<p><strong>Would appreciate any suggestions and if possible the change to be made in the code to solve this issue. Thanks!</strong></p>