Essentially, a replacement for
unet_learner(data, myCustomSequentialArch, …, pretrained=False)
that doesn’t throw
TypeError: conv2d(): argument 'input' (position 1) must be Tensor, not bool
Had this been a simple CNN, I’d use Learner instead of cnn_learner
Looking at the source I see I need to create a Learner with DynamicUnet built with myCustomSequentialArch
… but with the meta splits etc this feels like a good time to just ask.
Make the arch callable when you pass it in. Eg arch()
One thing to try.
nn.Sequetial IS callable.
Perhaps I wasn’t clear, but I didn’t want to spam a wall of text either:
I know that something_learner(…) methods expect pretrained models even if I don’t want to use pretrained weight. Heck, they depend on some metadata in learner.py that’s only present for known architectures.
myCustomSequentialArch is similar to the Sequential of conv_and_res from lesson 7, so I must use Learner directly, instead.
Thing with unet is, myCustomSequentialArch is only the generator part. From what I gather, to get the learner I want, I need to build a DynamicUnet as mentioned before.
XY problem and all, that’s just where I got stuck trying, and for all I know it might not even be the best path to the goal of building a unet learner from myCustomSequentialArch generator arch.
So, how to do that? Manually call everything that’s in unet_learner?
And if so, whether to call get_body first or not, and what does ‘split’ mean in meta?
I would also love to see a short example of a unet with a minimally simple untrained CNN model as its architecture.
What are the requirements for the shape of a custom architecture that is provided to the
Follow up: I was able to use the following PyTorch Unet model implementation to very easily to begin training an untrained Unet model. Just copy the code from the two files in the unet package.
I think this is a lot easier starting point than trying to get hack the FastAI Unet to work on a non-resnet, although FastAI does have a few tricks in its implementation that might be usefully incorporated.