resnet101 - (Not recommended) ResNet-101 convolutional neural network - MATLAB (original) (raw)

resnet101 is not recommended. Use the imagePretrainedNetwork function instead and specify"resnet101" as the model.

There are no plans to remove support for the resnet101 function. However, the imagePretrainedNetwork function has additional functionality that helps with transfer learning workflows. For example, you can specify the number of classes in your data using thenumClasses option, and the function returns a network that is ready for retraining without the need for modification.

The imagePretrainedNetwork function returns the network as a dlnetwork object, which does not store the class names, To get the class names of the pretrained network, use the second output argument of the imagePretrainedNetwork function.

This table shows some typical usages of the resnet101 function and how to update your code to use theimagePretrainedNetwork function instead.

Not Recommended Recommended
net = resnet101; [net,classNames] = imagePretrainedNetwork("resnet101");
net = resnet101(Weights="none"); net = imagePretrainedNetwork("resnet101",Weights="none");

The imagePretrainedNetwork returns a dlnetwork object, which also has these advantages:

To train a neural network specified as a dlnetwork object, use the trainnet function.