Converting Tensorflow Lite Model to Tensorflow Model - tensorflow

Is there's any way to convert a Tensorflow Lite model to a normal Tensorflow Model that i can use with Tensorflow.Javascript?

not supported by tfjs official converters as this is considered one-way conversion. but this tool is pretty amazing, although not the easiest to setup: https://github.com/PINTO0309/tflite2tensorflow

Related

Tensorflow Extended: Is it possible to use pytorch training loop in Tensorflow extended flow

I have trained an image classification model using pytorch.
Now, I want to move it from research to production pipeline.
I am thinking of using TensorFlow extended. I have a very noob doubt that will I'll be able to use my PyTorch trained model in the TensorFlow extended pipeline(I can convert the trained model to ONNX and then to Tensorflow compatible format).
I don't want to rewrite and retrain the training part to TensorFlow as it'll be a great overhead.
Is it possible or Is there any better way to productionize the PyTorch trained models?
You should be able to convert your PyTorch image classification model to Tensorflow format using ONNX, as long as you are using standard layers. I would recommend doing the conversion and then look at both model summaries to make sure they are relatively similar. Also, do some tests to make sure your converted model handles any particular edge cases you have. Once you have confirmed that the converted model works, save your model as a TF SavedModel format and then you should be able to use it in Tensorflow Extended (TFX).
For more info on the conversion process, see this tutorial: https://learnopencv.com/pytorch-to-tensorflow-model-conversion/
You could considering using the torchX library. I haven't use it yet, but it seems to make it easier to deploy models by creating and running model pipelines. I don't think it has the same data validation functionality that Tensorflow Extended has, but maybe that will be added in the future.

How to do fine tuning on TFlite model

I would like to fine tune a model on my own data. However the model is distributed by tflite format. Is there anyway to extract the model architecture and parameters out of the tflite file?
One approach could be to convert the TFLite file to another format, and import into a deep learning framework that supports training.
Something like ONNX, using tflite2onnx, and then import into a framework of your choice. Not all frameworks can import from ONNX (e.g. PyTorch). I believe you can train with ONNXRuntime, and MXNet. Unsure if you can train using TensorFlow.
I'm not sure to understand what you need. But if you want to know the exact architecture of your model you can use neutron to find out.
You will get something like the this :
And for your information TensorFlow Lite is not meant to be finetuned. You need to finetune a classic TensorFlow model and then convert it to TensorFlow Lite.

BidirectionalRNN in tensorflow keras for tensorflow lite

I want to convert a model using the bidirectional RNN to a tensorflow lite model.
What can be an equivalent way of achieving the same effect as tf.keras.layers.Bidirectional by writing lower level code.
some of the derivations for that code can be found in this course.

Can I quantize my tensorflow graph for the full version of TF, not tflite?

I need to quantify my model for use in the full version of tensorflow. And I do not find how to do this (in the official manual for quantization of the model, the model is saved in the format tflite)
AFAIK the only supported quantization scheme in tensorflow is tflite. What do you plan to do with a quantized tensorflow graph? If it is inference only, why not simply use tflite?

Can I run a model trained using tensorflow on mxnet?

I have models trained on tensorflow. Can I use mxnet in forward only mode to run these ?
https://github.com/dmlc/nnvm says this should be possible in future, but is the support available today ?
MXNet doesn't have tensorflow model converter yet. It does have a caffe-to-mxnet converter. So you can convert your tf model to caffe, that would work..
https://github.com/dmlc/mxnet/tree/master/tools/caffe_converter