I’ve been struggling with this for a while now. Most resources I find seem to be for fastai using older versions of pytorch and thus the load_learner call expects a .pkl file. But the current fastai v2 exports a zip file due to the new version of pytorch.
I tried my best to upgrade my installs on the production server to the newer fastai but it always has some issue or another. And the same occurs when i try to just use an older notebook on an older pytorch version to do the training.
Is there a relatively current guide to deploying a fastai v2 trained model to production so I can send images to it and get a result?
one more resource, there are a series of notebooks here, yhatpub/notebooks/fastai at main · yhatpub/yhatpub · GitHub which have examples of loading a learner and running inference for most the fastai lessons. it’s focused on the yhat.pub service, but you can just pick the pieces from the notebook you need.