mtcnn_facenet_cpp_tensorRT icon indicating copy to clipboard operation
mtcnn_facenet_cpp_tensorRT copied to clipboard

Failed to convert facenet.pb model to facenet.onnx model

Open do-van-long opened this issue 5 years ago • 3 comments

Hi @nwesem, Since converting a tensorflow model to UFF model will be deprecated in the future and transforming deep learning models to ONNX is becoming popular, I have tried to convert facenet.pb to facenet.onnx using tf2onnx but I have not succeeded. The problem is that there are some layers in facenet.pb that are not supported in tf2onnx. Have you ever tried to do that? or Could anyone give me some suggestions on how to DEBUG? One of the BUGs is File "/home/vanlong/.virtualenvs/facerecog/lib/python3.6/site-packages/tensorflow/python/framework/importer.py", line 430, in import_graph_def raise ValueError(str(e)) ValueError: Shape must be rank 4 but is rank 0 for 'InceptionResnetV1/Conv2d_1a_3x3/BatchNorm/batchnorm/mul' (op: 'Conv2D') with input shapes: [], [3,3,3,32].

do-van-long avatar May 12 '20 16:05 do-van-long

Have you found a solution to this issue yet @do-van-long ?

nwesem avatar Jun 01 '20 13:06 nwesem

I have successfully converted Facenet to ONNX model. But, the facenet.pb file provided by this repo didn't work. I used facenet_keras.h5 provided in this tutorial and convert it to ONNX and then to TRT using this tutorial provided by Nvidia

AnasMK avatar Oct 01 '20 16:10 AnasMK

Check this repo riotu-lab/tf2trt_with_onnx to covert Facenet model to TensorRT engine and use it with Python

AnasMK avatar Oct 08 '20 20:10 AnasMK