I am using CNTK's model edit language to load a pre-trained Resnet model, add a new last layer, and refine the model on some new dataset.
I would also like to change the network architecture to accept higher resolution images as input (which is possible since my net is fully convolutional without the last fc layer). Does anyone know how to do that / of a relevant link?
Thanks!
ps. This is how my current .mel file looks like (for an AlexNet):
#load pre-trained model
model1 = LoadModel("$OrigModel$") #, format=cntk)
SetDefaultModel(model1)
#parameters from original ndl file
cMap4 = 512
fcWScale = 1.13
fcBValue = 0
labelDimNew=10
#add new final layer
newL = DnnLayer(cMap4, $labelDimNew$, pool5, fcWScale, fcBValue)
labelsNew = Input($labelDimNew$, tag="label")
SetInput(ce, 0, labelsNew)
SetInput(ce, 1, newL.z)
SetInput(err, 0, labelsNew)
SetInput(err, 1, newL.z)
SetProperty(newL.z, "output", "true")
#remove old final layer (note: make sure these deletes happen in reverse order)
DeleteNode(OutputNodes.z)
DeleteNode(OutputNodes.t)
DeleteNode(OutputNodes.b)
DeleteNode(OutputNodes.W)
DeleteNode(labels)
#rename nodes to have same name as before. this might not be necessary.
Rename(labelsNew, labels)
Rename(newL.*, OutputNodes.*)