How to export a cross-validated model

After training a ResNet50 model with k-fold cross validation, How would I go about exporting this model in order to use it for inference?

For each of the folds, you can export that fold’s model via the learn.export() function and then load it during test-time/inference using the load_learner() function. Of course, for each of the k models you want to save the file with a different name, preferably indicating which fold it is coming from.

thanks for the reply @ilovescience!

Let me see if I understand, in inference pipelines, I would have to load all the k models and get the predictions of all k, then average the predictions?

Yep this is usually the desired scenario…

Got it, thank you!