Hi,
I would like to first fine-tune a resnet34 classifier on a task and then use it as the encoder of a U-Net model for segmentation purposes.
I proceeded as follows:
-
Fine-tune resnet34
learner= cnn_learder(data, models.resnet34, ...)
learner.fit(epochs=1)
-
Remove the head
model = learner.model
removed = list(model.children())[:-1]
model= torch.nn.Sequential(*removed)
-
Create U-Net
DynamicUnet(model, n_classes=2)
It returns the following error:
I suspect that DynamicUnet does not like the cut