Open ken4647 opened 1 year ago
Here is my h5 model.
Please check if you have enable bias for conv layers. Conv layers must have bias for successful conversion, it is a requirement for the backend.
Thanks for your reply!I have confirmed that all biases in the model have been enabled. I have try to fix this promblem by change the name of layer.After struggling for days, I have successfully convert my model to nnom's. However, the result is not right, as I find that ONNX model is in the format of NCHW and h5 model is default in NHWC, while cause my model can't produce true result.
And I want to ask if there any other way to convert other formats of model like pytorch/tflite/onnx/savedmodel? Or is there any good way to convert onnx model to h5 or nnom model? I have used the
onnx2keras
, which stop updating for too long.
keras is simple of course, however re-train all my model is really a tough thing. Thanks for your reply!
As Keras is in format of NHWC, nnom seems directly do conv2d and pad and maxpool at the first two dimensions, make the computation become totally wrong.
I only tested it in keras/tf2. ONNX model are not tested. Looks like the data format is an issue.
The problem I encountered when I tried to convert h5 model(which convert from onnx model) to weights.h. Its reason seems to be there:
While my layer's name like
LAYER_0
. Is it right? The question is why the layer is judged on itsname
attribute instead oftype()
(just as a beginner)? And is there a good way to fix it?