I have a set of data that I’m trying to analyze in different ways. Because of this, I have 2 models I’m working with, one that classifies it into 2 classes, and one that uses 3 classes.
It would be helpful to me to be able to load in a model given just a path to it. Currently, I’m using:
learn = cnn_learner(dls, resnet50, metrics=error_rate)
learn = learn.load(modelPath)
However, this throws a runtime error when I try to load the 3 class model. Is there any way I could create a learner or model object independent of the structure of the model it’s directed to? All I need to be able to do once the model is loaded is get prediction values from individual images.