PINTO0309 / tflite2tensorflow

Generate saved_model, tfjs, tf-trt, EdgeTPU, CoreML, quantized tflite, ONNX, OpenVINO, Myriad Inference Engine blob and .pb from .tflite. Support for building environments with Docker. It is possible to directly access the host PC GUI and the camera to verify the operation. NVIDIA GPU (dGPU) support. Intel iHD GPU (iGPU) support. Supports inverse quantization of INT8 quantization model.
https://qiita.com/PINTO
MIT License
262 stars 41 forks source link

Failling to import converted pb file in tensorflow. #3

Closed soham24 closed 3 years ago

soham24 commented 3 years ago

Hello, I have successfully converted tflite file to pb using your script.
But I am not able to load this in tensorflow. I am wondering what steps I have missed. I am attaching pb file with thi sissue.
hair_seg.zip

thank you

PINTO0309 commented 3 years ago

I just ran the following command, and it seems to be converting well. saved_model.pb is a special format of saved_model format. model_float32.pb is a format that can be read by Netron.

$ tflite2tensorflow \
  --model_path hair_segmentation.tflite \
  --flatc_path ../flatc \
  --schema_path ../schema.fbs \
  --output_pb True

$ tflite2tensorflow \
  --model_path hair_segmentation.tflite \
  --flatc_path ../flatc \
  --schema_path ../schema.fbs \
  --output_no_quant_float32_tflite True

Screenshot 2021-02-16 22:51:33 Screenshot 2021-02-16 22:54:22

PINTO0309 commented 3 years ago

The problem has been resolved. I will consolidate to issue #2 in the link.