nwesem / mtcnn_facenet_cpp_tensorRT

Face Recognition on NVIDIA Jetson (Nano) using TensorRT
GNU General Public License v3.0
200 stars 72 forks source link

Embeddings do not match with the original facenet_keras.h5 #40

Open sahilkhatri opened 3 years ago

sahilkhatri commented 3 years ago

Hey, I created facenet_engine.plan file using the facenet.onnx file. When I ran the code for inference, it didn't gave any correct recognition results. I compared the embeddings (same image) generated from facenet.h5 and facenet_engine.plan file, it turns out that they both are COMPLETELY DIFFERENT. What could possibly be the reason for this strange result?

Also, I got error "AssertionError: Bottleneck_BatchNorm/batchnorm_1/add_1:0 is not in graph" while converting from facenet.pb to facenet.onnx. So, I used the command "python -m tf2onnx.convert --input path-to-facenet.pb --inputs input:0[1,160,160,3] --inputs-as-nchw input_1:0 --outputs Bottleneck/BatchNorm/batchnorm/add_1:0 --output path-to-save-facenet.onnx" instead. Later one worked without causing any error.

Please help me to get the right embeddings! Thank you!

shubham-shahh commented 2 years ago

Hey, I created facenet_engine.plan file using the facenet.onnx file. When I ran the code for inference, it didn't gave any correct recognition results. I compared the embeddings (same image) generated from facenet.h5 and facenet_engine.plan file, it turns out that they both are COMPLETELY DIFFERENT. What could possibly be the reason for this strange result?

Also, I got error "AssertionError: Bottleneck_BatchNorm/batchnorm_1/add_1:0 is not in graph" while converting from facenet.pb to facenet.onnx. So, I used the command "python -m tf2onnx.convert --input path-to-facenet.pb --inputs input:0[1,160,160,3] --inputs-as-nchw input_1:0 --outputs Bottleneck/BatchNorm/batchnorm/add_1:0 --output path-to-save-facenet.onnx" instead. Later one worked without causing any error.

Please help me to get the right embeddings! Thank you!

Hi, did you follow all the instructions mentioned in the develop branch?