ncnn
ncnn copied to clipboard
SSR-Net keras -> onnx -> ncnn, Segmentation fault (core dumped) error.
Hi all,
I am trying to use ncnn framework for age and gender recognition using SSR-Net model. At first I have converted SSR-Net age/gender model to ONNX using keras2onnx convertion tool. Now Those ONNX models are converted to NCNN. Up to this stage, everything was successful, but while I tried to use NCNN for inference it says find_blob_index_by_name .. failed error.
Although this error seems obvious, I am wondering if anyone here have workaround for such issues.
Here I attached original keras models and both onnx and ncnn converted models.
ssrnet-age_gender_keras.zip ssrnet_age-gender-onnx.zip ssrnet_age-gender_ncnn.zip
Error log:
find_blob_index_by_name dense_6/bias:0 failed
find_blob_index_by_name dense_7/bias:0 failed
find_blob_index_by_name delta_s3/bias:0 failed
find_blob_index_by_name pred_a/mul_31/x:0 failed
find_blob_index_by_name dense_3/bias:0 failed
find_blob_index_by_name dense_4/bias:0 failed
find_blob_index_by_name pred_a/add_23/x:0 failed
find_blob_index_by_name delta_s2/bias:0 failed
find_blob_index_by_name dense_8/bias:0 failed
find_blob_index_by_name pred_a/mul_32/x:0 failed
find_blob_index_by_name pred_a/mul_19/x:0 failed
find_blob_index_by_name pred_a/add_14/x:0 failed
find_blob_index_by_name pred_age_stage3/bias:0 failed
find_blob_index_by_name local_delta_stage3/bias:0 failed
find_blob_index_by_name dense_5/bias:0 failed
find_blob_index_by_name dense/bias:0 failed
find_blob_index_by_name dense_1/bias:0 failed
find_blob_index_by_name pred_a/mul_20/x:0 failed
find_blob_index_by_name delta_s1/bias:0 failed
find_blob_index_by_name pred_a/mul_9/x:0 failed
find_blob_index_by_name pred_age_stage2/bias:0 failed
find_blob_index_by_name local_delta_stage2/bias:0 failed
find_blob_index_by_name pred_a/add_6/x:0 failed
find_blob_index_by_name pred_a/mul_25/x:0 failed
find_blob_index_by_name pred_a/mul_23/x:0 failed
find_blob_index_by_name pred_a/mul_21/x:0 failed
find_blob_index_by_name dense_2/bias:0 failed
find_blob_index_by_name pred_a/mul_10/x:0 failed
find_blob_index_by_name pred_a/add_19/x:0 failed
find_blob_index_by_name pred_a/add_17/x:0 failed
find_blob_index_by_name pred_a/add_15/x:0 failed
find_blob_index_by_name pred_a/mul_15/x:0 failed
find_blob_index_by_name pred_a/mul_13/x:0 failed
find_blob_index_by_name pred_a/mul_11/x:0 failed
find_blob_index_by_name pred_age_stage1/bias:0 failed
find_blob_index_by_name local_delta_stage1/bias:0 failed
find_blob_index_by_name pred_a/add_11/x:0 failed
find_blob_index_by_name pred_a/add_9/x:0 failed
find_blob_index_by_name pred_a/add_7/x:0 failed
find_blob_index_by_name pred_a/mul/y:0 failed
find_blob_index_by_name pred_a/mul_7/x:0 failed
find_blob_index_by_name pred_a/mul_5/x:0 failed
find_blob_index_by_name pred_a/mul_3/x:0 failed
find_blob_index_by_name pred_a/add_4/x:0 failed
find_blob_index_by_name pred_a/add_2/x:0 failed
find_blob_index_by_name pred_a/add/x:0 failed
find_blob_index_by_name pred_a/mul_33/y:0 failed
parse layer_type failed
load age-gender model failed.
Segmentation fault (core dumped)
Thank you in advance.
Best Deepak
As far as I know, onnx2ncnn only supports the onnx models converted from pytorch. There is a keras2ncnn utility being developed by the community, but I don't know when it will be ready for practical usecases. You may interest in https://github.com/hanzy88/tensorflow2ncnn
Hi, @ghimiredhikura. You may have difficulty of lambda layer in SSR-Net for age and gender classification. When I use pytorch version of SSR-Net, I had met the similar problem in model conversion. At that time, I have converted model successfully except lambda layer of final part of model architecture. (torch -> onnx -> mnn)
Hi, try keras2ncnn https://github.com/MarsTechHAN/keras2ncnn
When the model is converted to onnx, there are many “gather” in the model. How to eliminate these structures。we used "onnxsim"