Hi all. I wrote a notebook to share how one could use any pretrained models in Pytorch. Fastai itself has a lot of pretrained models. There is also the fantastic library by Cadene https://github.com/Cadene/pretrained-models.pytorch which has a lot of pretrained models on imagenet. I show how to use them with the fastai library.
Link to the notebook: https://github.com/TheShadow29/FAI-notes/blob/master/notebooks/Using-Pretrained-Pytorch-Models.ipynb
Feel free to create an issue if there is something amiss, or report it here.
10 Likes
charming
(Charm)
July 12, 2018, 11:29am
3
This problem has plagued me very much, thank you very much.!
Vary helpful.
I was quite confuse about these problems before.
Is there any way to easily use these pre-trained models in fastai 1.0 too?
Zshan
(P MD ZEESHAN SHEIKH)
March 15, 2019, 1:06pm
6
Can I use these pretrained models in the current version of fastai?
hmnshu
(Himanshu)
July 2, 2019, 5:26am
7
How can this be used with the latest version of fastai - 1.0.54? Any help will be much appreciated. Present learner seems to have support for below but not Cadene Repo:
models.resnet18 :{**_resnet_meta}, models.resnet34: {**_resnet_meta},
models.resnet50 :{**_resnet_meta}, models.resnet101:{**_resnet_meta},
models.resnet152:{**_resnet_meta},
models.squeezenet1_0:{**_squeezenet_meta},
models.squeezenet1_1:{**_squeezenet_meta},
models.densenet121:{**_densenet_meta}, models.densenet169:{**_densenet_meta},
models.densenet201:{**_densenet_meta}, models.densenet161:{**_densenet_meta},
models.vgg16_bn:{**_vgg_meta}, models.vgg19_bn:{**_vgg_meta},
models.alexnet:{**_alexnet_meta}}
hmnshu
(Himanshu)
July 4, 2019, 8:43pm
8
Got reply to this on another thread - this could work.
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# CNN Architectures and How to Use Them with fastai"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"__Update__: \n",
"\n",
"* [Torchvision models](https://pytorch.org/docs/stable/torchvision/index.html) are all included in fastai v1 in [this PR](https://github.com/fastai/fastai/pull/1523), except for \"inception_v3\" (check the \"Inception\" section to see why it's left out and a workaround). \n",
"\n",
"* Most of the [Cadene pretrained models](https://github.com/Cadene/pretrained-models.pytorch) are included in fastai v1 in [this PR](https://github.com/fastai/fastai/pull/1753). You can directly import the models, just like ResNets. See [this file](PR_test.ipynb) for some examples.\n",
"\n",
"* EfficientNet is added."
This file has been truncated. show original
aikez
April 26, 2020, 3:02pm
9
This is a really great job!