Modifying a 3 band model for additional bands

Hi Nick. I’m guessing that the line that generates the error is
learn = unet_learner(dl, resnet18, n_in=4, n_out=2, pretrained=False, loss_func=loss_fn, metrics=acc_metric)

The tutorial you linked unfortunately requires me to join the Kaggle competition and download the data locally. That’s a lot of work! I am willing to do so if necessary, but maybe a shortcut will be enough.

Could you post what this gives…
dl.one_batch()[0].shape

And the offending line and complete stack trace. Also please take a look at the link below. It gives many helpful debugging and posting tips.
https://forums.fast.ai/t/how-to-debug-your-code-and-ask-for-help-with-fastai-v2/64196

If you can do a bit of pre-debugging, it will save hassle for both of us by narrowing down the possibilities.

You might even have found a bug in fastai - wouldn’t that be exciting!

:slightly_smiling_face: