How to convert model trained with fastai to Tensorflow?

Hello everybody!

I have finetuned a resnet34 model on a Multi Label Classification task very easily with fastai v1, now I want to convert the weights and the model architecture to use it with different frameworks.

The first framework on my list in Tensorflow.

I want to allow people to load the weights in the model architecture in TF, to freeze parts of the model and then to start fine-tuning or tweaking it in Tensorflow. (as if it was originally trained in TF to begin with).

I first thought of onnx but it looks like importation is only for inference.

Do you have an idea of how I can fully convert fastai model to Tensorflow?

P.S.: I am not looking for an easy way to do this, I am looking for a clean way to do this.

context: I want to provide the finetuned model as a starting point for a Data Science competition, as it is currently in it won’t be fair for experimented TF users to only provide the starting point in fastai. To make it fair, I want to port it in TF so people can have the choice of using Fastai or Tensorflow.

1 Like

Hi remico, have you managed to convert your model? I am starting off down the same road so your input would be valuable. Thanks