Given transposed=1, weight of size [768, 128, 3, 3, 3], expected input[4, 512, 3, 3, 3] to have 768 channels, but got 512 channels instead

MARTINA_NIGRO: <p>Hello, I am having a problem with a neural network, I am a beginner and so even if I found similar topics I don’t understand where my problem is. The network I am using is the following:<br>
<a href="https://github.com/kbressem/prostate158" class="inline-onebox" rel="noopener nofollow ugc">GitHub - kbressem/prostate158</a>    (is a model using a UNet structure)<br>
and my problem is that after training the model, when I try to evaluate the model on the test dataset using the code that is suggested in the README, I get the following error:</p>
<p>RuntimeError: Given transposed=1, weight of size [768, 128, 3, 3, 3], expected input[4, 512, 3, 3, 3] to have 768 channels, but got 512 channels instead</p>
<p>I really don’t know how to fix this and I would really appreciate your help.<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/6/c/6c74d6d9d970a2ea20e76cdf4388bf1467ad9388.png" data-download-href="https://discuss.pytorch.org/uploads/default/6c74d6d9d970a2ea20e76cdf4388bf1467ad9388" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/6/c/6c74d6d9d970a2ea20e76cdf4388bf1467ad9388_2_690x388.png" alt="image" data-base62-sha1="ftrTpETDZA5pL3lm2XDabmCYHTa" width="690" height="388" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/6/c/6c74d6d9d970a2ea20e76cdf4388bf1467ad9388_2_690x388.png, https://discuss.pytorch.org/uploads/default/optimized/3X/6/c/6c74d6d9d970a2ea20e76cdf4388bf1467ad9388_2_1035x582.png 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/6/c/6c74d6d9d970a2ea20e76cdf4388bf1467ad9388_2_1380x776.png 2x" data-dominant-color="F9DBD8"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">1472×828 60.2 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>

ptrblck: <p>Could you post the arguments you are using to create the <code>UNet</code> from <code>MONAI</code>, please?</p>

MARTINA_NIGRO: <p>I am using the code provided by the github page (shown in the picture), where the anatomy.yaml file is as follows:</p><aside class="onebox githubblob" data-onebox-src="https://github.com/kbressem/prostate158/blob/main/anatomy.yaml">
  <header class="source">

      <a href="https://github.com/kbressem/prostate158/blob/main/anatomy.yaml" target="_blank" rel="noopener nofollow ugc">github.com</a>
  </header>

  <article class="onebox-body">
    <h4><a href="https://github.com/kbressem/prostate158/blob/main/anatomy.yaml" target="_blank" rel="noopener nofollow ugc">kbressem/prostate158/blob/main/anatomy.yaml</a></h4>


      <pre><code class="lang-yaml">debug: False
overwrite: False # overwrite outputs of last run if run_id was not changed
ndim: 3
run_id: anatomy
out_dir: output
model_dir: models
log_dir: logs
seed: 42
device: 'cuda:0'
data:
  data_dir: prostate158
  train_csv: prostate158/train.csv
  valid_csv: prostate158/valid.csv
  test_csv: prostate158/test.csv
  # col names of the image and label files. Pass multiple names as list
  image_cols: t2
  label_cols: t2_anatomy_reader1
  train: True
  valid: True
  test: False
</code></pre>



  This file has been truncated. <a href="https://github.com/kbressem/prostate158/blob/main/anatomy.yaml" target="_blank" rel="noopener nofollow ugc">show original</a>

  </article>

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

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

<p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/8/6/867fd0ff5c514560d3caf6f6048dfb3188284dd5.png" data-download-href="https://discuss.pytorch.org/uploads/default/867fd0ff5c514560d3caf6f6048dfb3188284dd5" title="code"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/8/6/867fd0ff5c514560d3caf6f6048dfb3188284dd5_2_690x359.png" alt="code" data-base62-sha1="jbPPeHR4awgDZvKKqHbfXLrvquh" width="690" height="359" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/8/6/867fd0ff5c514560d3caf6f6048dfb3188284dd5_2_690x359.png, https://discuss.pytorch.org/uploads/default/optimized/3X/8/6/867fd0ff5c514560d3caf6f6048dfb3188284dd5_2_1035x538.png 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/8/6/867fd0ff5c514560d3caf6f6048dfb3188284dd5_2_1380x718.png 2x" data-dominant-color="F1F0F0"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">code</span><span class="informations">1445×752 44 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>