How to Load a pre-trained model into Keras without the Weight and bias? - tensorflow

I need to Load a pre-trained model into Keras without the Weight and bias. I
also just want to use the Architecture of the model alone for my training.
Example:
I want to load coco_mobilenet model pre-trained without Weights and bias.
Any suggestions would be appreciated.

net=keras.applications.MobileNet(weight=None)
net.summary()
view keras mobilenet api for detail

Related

What is a lite model in Deep Learning?

I wanted to know what is a lite model?
I know that a model that is easier to train and has fewer neurons is a lite model but how to say how much are these "fewer neurons"??
If I use a pre-trained model and add two Dense layers to it (where I freeze those pre-trained model layers and train only the Final two layers) can I call these a lite model as it is faster to train and inference results are also fast???

Can I add Tensorflow Fake Quantization in a Keras sequential model?

I have searched this for a while, but it seems Keras only has quantization feature after the model is trained. I wish to add Tensorflow fake quantization to my Keras sequential model. According to Tensorflow's doc, I need these two functions to do fake quantization: tf.contrib.quantize.create_training_graph() and tf.contrib.quantize.create_eval_graph().
My question is has anyone managed to add these two functions in a Keras model? If yes, where should these two function be added? For example, before model.compile or after model.fit or somewhere else? Thanks in advance.
I worked around by post-training quantization. Since my final goal is to train a mdoel for mobile device, instead of fake quantization during training, I exported keras .h5 file and converted to Tenforflow lite .tflite file directly (with post_training_quantize flag set to true). I tested this on a simple cifar-10 model. The original keras model and the quantized tflite model have very close accuracy (the quantized one a bit lower).
Post-training quantization: https://www.tensorflow.org/performance/post_training_quantization
Convert Keras model to tensorflow lite: https://github.com/tensorflow/tensorflow/blob/master/tensorflow/contrib/lite/toco/g3doc/python_api.md
Used the tf-nightly tensorflow here: https://pypi.org/project/tf-nightly/
If you still want to do fake quantization (because for some model, post-training quantization may give poor accuracy according to Google), the original webpage is down last week. But you can find it from github: https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/quantize
Update: Turns out post-quantization does not really quantize the model. During inference, it still uses float32 kernels to do calculations. Thus, I've switched to quantization-aware training. The accuracy is pretty good for my cifar10 model.

ResNet34 - Pretrained model on imagenet using tensorflow

Can someone point me to the Resnet34 pre-trained model on image-net using tensorflow? I am not sure but TF-slim trained model are same or would there be difference?
You can use Keras ResNet(18,34,50,101,152) pre-trained models https://github.com/qubvel/classification_models

How to use a pre trained model on Image net in tensorflow object detection api

I am trying to use the Inception SSD model in tensorflow object detection API. To initialize the weights i want to use pretrained Inception V2 On image net as the feature extractor. I see the model config file lets you use a pretrained model on COCO but if I want to use an Image net model how should I go about it?
To train on Imagenet classification models, do the following:
1) Download a pre-trained model from the "Pre-trained models" section on the Slim page
2) Point the fine_tune_checkpoint at that directory
3) Set from_detection_checkpoint to be false (as you will now be fine-tuning from a classification checkpoint)
Note that training from an Imagenet classification checkpoint will require significantly more time.

How to load a pretrained vgg model in distributed tensorflow model training scene like faster-rcnn?

I want to implements a faster-rcnn model using distributed tensorflow, But I have difficult to load a pretrained vgg model,How to do it? thanks
The TensorFlow tutorial on retraining inception is a good start to read. Then try to reproduce what it does starting from an already trained vgg model.