wangjing60755

Results 16 comments of wangjing60755

def _hard_swish(self, x): """Hard swish """ return x * K.relu(x + 3.0, max_value=6.0) / 6.0

A new problem . How to support user-defined functions, similar to the load function in keras has custom_objects. ` model = k.models.load_model(model_path, compile=False, custom_objects={ 'my_fun': my_fun } )`

Here is a example! [LiteRASSP_small256.zip](https://github.com/MarsTechHAN/keras2ncnn/files/6286238/LiteRASSP_small256.zip)

现在模型转换没问题,但是,用CPP推理直接卡死,然后就挂了(其他类似结构模型用你的代码转换之后能成功推理),所以是不是这个hard_swish哪里没弄好?

[seg_ncnn_inference.txt](https://github.com/MarsTechHAN/keras2ncnn/files/6289415/seg_ncnn_inference.txt)

Ncnn result error! ![对比](https://user-images.githubusercontent.com/35362513/114336319-3090b680-9b3e-11eb-8422-131299a40dfb.JPG) [result_nomatch.zip](https://github.com/MarsTechHAN/keras2ncnn/files/6293662/result_nomatch.zip)

No custom objects, result_nomatch.zip contains inference code with python and c++.