Download pretrained ImageNet model of ResNet, VGG, etc. (.PB file) - python

I have downloaded a pre-trained model on ImageNet of Inception v3 from http://download.tensorflow.org/models/image/imagenet/inception-2015-12-05.tgz (found this link while following one of the tutorials on codelabs).
This zip file contains .pb file that I can directly import as GraphDef in TensorFlow.
I would like to know if there are similar .pb files for other architectures as well, such as ResNet, VGG16, MobileNet, etc. If yes, could you provide the link of those?
Thanks in advance.
Kind Regards,
Ajay

You can find many pretrained models here: https://github.com/tensorflow/models/tree/master/research/slim#pre-trained-models
And the corresponding codes are here:
https://github.com/tensorflow/models/tree/master/research/slim/nets

Here are addition sources to download pretrained models:
TensorFlow Hub: https://tfhub.dev/
ModelZoo: https://modelzoo.co/
Though slightly different, Keras provides an interface to access pretrained models:
https://keras.io/api/applications/

Related

How to use a trained Tensorflow Lite model in python?

I have a Tensorflow Lite model (.tflite file), which is already trained.
I need to use it in an API python view that receives recorded .wav files for speech recognition, and returns the equivalent text to the recorded file that was sent.
Any advices ou tutos on how I could use the trained model in order to treat the recorded instructions?
Thanks.
Refer to the TFLite Inference Guide for more details.
Specifically, for python refer to this

Converting teachable machine model into tflite format

So I have trained a posenet model for classifying different poses on the teachable machine learning website (link for the website). I want to use this trained model in a flutter app, and for that I need to convert the model into tflite format. I checked many online blogs which said that the website has an option of converting it to that format, but they have removed that feature. Thus, I wanted to know how can I convert this teachable machine model into tflite format?
I downloaded a pose model of my own from that site, and the zip appears to be a Tensorflow.JS model.
Now that we know the unzipped file is just a TF.js model, refer to a tutorial like this to convert the TFJS model back into a keras SavedModel, which can be then saved into a tflite model.

How to convert a Tensorflow model checkpoint to Pytorch?

I'm working with a Deep Learning model which has a ResNet-50 as backbone pretrained on ImageNet. The dataset that I'm using is the CUB-200, which is a set of 200 species of birds. For this reason I think that could be good to have a pretrained model on a dataset that has a similar domain and I found that the iNaturalist one could be the one that I'm looking for.
The problem is that I didn't find any pretrained model for Pytorch, but only a Tensorflow one here.
I tried to convert it using the MDNN library, but it needs also the '.ckpt.meta' file extend and I have only the '.ckpt'.
This is an example of how to use the MDNN library to convert a tf model to torch:
mmconvert -sf tensorflow -in imagenet_resnet_v2_152.ckpt.meta -iw imagenet_resnet_v2_152.ckpt --dstNode MMdnn_Output -df pytorch -om tf_to_pytorch_resnet_152.pth
Could anyone help me with it?

Which ImageNet classes is PyTorch trained on?

PyTorch lets you download pre-trained models for classification here, but it's not clear how to go from the output tensor of probabilities back to the actual class labels. Any ideas?
See example here: https://discuss.pytorch.org/t/imagenet-classes/4923
https://www.learnopencv.com/pytorch-for-beginners-image-classification-using-pre-trained-models/
You need to download imagenet_classes.txt

Load tensorflow checkpoint as keras model

I have an old model defined and trained using tensorflow, and now I would like to work on it but I'm currently using Keras for everything.
So the question is: is it possible to load a tf cehckpoint (with *.index, *.meta etc..) into a Keras model?
I am aware of old questions like: How can I convert a trained Tensorflow model to Keras?.
I am hoping that after 2 years, and with keras being included into tf, there would be a easier way to do it now.
Unfortunately I don't have the original model definition in tf; I may be able to find it, but it would be nicer if it wasn't necessary.
Thanks!
In the below link, which is the official TensorFlow tutorial, the trained model is saved and it has .ckpt extension. After, it is loaded and is used with Keras model.
I think it might help you.
https://www.tensorflow.org/tutorials/keras/save_and_restore_models

Categories

Resources