Closed MjiS closed 2 years ago
Unfortunately, there are no plans to implement a recurrent layer. LSTM = LSTMCell = TensorIterator + α
{
"format_version": 2,
"layers": [
{
"layer_id": "41",
"type": "Const",
"replace_mode": "direct",
"values": [
0,
3,
1,
2
]
}
]
}
docker run -it --rm \
-v `pwd`:/home/user/workdir \
ghcr.io/pinto0309/openvino2tensorflow:latest
$INTEL_OPENVINO_DIR/deployment_tools/model_optimizer/mo.py \ --input_model custom_ocr1.onnx \ --data_type FP32 \ --output_dir openvino/FP32 \ --model_name custom_ocr1
openvino2tensorflow \ --model_path openvino/FP32/custom_ocr1.xml \ --output_saved_model \ --output_pb \ --output_no_quant_float32_tflite \ --non_verbose \ --weight_replacement_config replace.json
- Log
The TensorIterator layer is not yet implemented.
Thank you for your reply. Any solution to this or any other way I can convert this model to tflite. I tried PyTorch > ONNX > PB > tflite. I had issues converting PB to tflite, I tried
pip install toco
!toco --graph_def_file='/content/export1/saved_model.pb' --output_file='/content/custom_ocr.tflite' --input_format=TENSORFLOW_GRAPHDEF --output_format=TFLITE --input_shape=32,1,256,256 --input_array=ResizeBilinear --output_array=final_result --inference_type=FLOAT --input_type=FLOAT --saved_model_dir '/content/export1'
It did converted the file to tflite but I was unable to properly utilize it. Here is the link for tflite file https://drive.google.com/file/d/17YJNfiYegeUvBgLKbZkKNNNS3orAhlDw/view?usp=sharing Can you look into it. Is this tflite converted properly ?
I've tried every easy conversion method you can think of. To sum up, there is no easy way to convert.
You can extract the weights one by one from ONNX and read them into the Keras model to regenerate them. I am not going to implement it as it is a high work cost. However, I think it's a much more meaningful way to spend your time than wasting it on worries.
Issue Type
Bug, Others
OS
Ubuntu, Other
OS architecture
x86_64, aarch64, Other
Programming Language
Python, Other
Framework
OpenVINO, TensorFlowLite
Download URL for ONNX / OpenVINO IR
OpenVino Files: https://drive.google.com/file/d/1TGpFkPv62mos3ZaxFk0sbhx4cpGP8zuP/view?usp=sharing ONNX File: https://drive.google.com/file/d/1-KgxCUxfXmX-L2vuxSzMZC9WhV2vq_S0/view?usp=sharing Pytorch File: https://drive.google.com/file/d/1-8XmqzoM2kR5IM_lhsAO0yp7rjpLQ4gS/view?usp=sharing
Convert Script
Description
Hi, I'm using EasyOCR custom_example.pth model for conversion.It is pytorch based. I can easily convert it to ONNX > ONNX Simplified > OpenVino but I can't convert it to tflite using you openvino2tensorflow.py. I'm using Colab for this. I had trouble getting Openvino mo.py so I converted it manually to ONNX from there on I followed your steps.
Sorry for my mistakes, I'm new to this.
I can share you my colab notebook if you got any issues regarding my approach.
Here is the repos link I'm trying to convert.
Relevant Log Output
Log
Source code for simple inference testing code
No response