Skip to content
Shows how to use your own pretrained models in the Fastai library
Jupyter Notebook Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea
FakeData
models
README.md
basic_2_class_model.ipynb
transfer-learning.ipynb
transfer.py

README.md

Custom-Pretrained-Models-in-Fastai

Shows how to use your own pretrained models in the Fastai library

Note that this code works with Fastai version 1.0.54


1. Depending on what format your model is in, do either of:
# If you exported your model using fastai's export function like so: learn.export()
model_func = model_from_export(PATH_TO_MODEL)
# If you exported your model using PyTorch's save feature like so: torch.save(model)
model_func = model_from_torch(PATH_TO_MODEL)
  1. From here on it's pretty straight forward:
custom_cnn_learner = get_custom_resnet_learner()
learn = custom_cnn_learner(data, model_func, ...usual parameteres---)
  1. Beyond this point, it's the usual FastAI model training procedures.

I'd love to hear from you if you find this useful!

You can’t perform that action at this time.