Closed PINTO0309 closed 1 month ago
Is this the possiblity to add our own weights after the quantization?
No. The -prf
option only does simple tensor transposition or some other OP substitutions. onnx2tf does not have the ability to add weights. I think adding weights when converting a model with onnx2tf is beyond the scope of the tool's responsibility.
Therefore, it is better to process ONNX files directly. https://github.com/ZhangGe6/onnx-modifier https://github.com/PINTO0309/simple-onnx-processing-tools
Ah thank you, the problem is that when you modify the ONNX and than convert it in tflite, the weights get changed automatically. I was trying to find a way to have the weights I want in the tflite.
Since the quantization flow is only provided via the TFLiteConverter API, you will likely need to rewrite the Flatbuffer directly after quantization to achieve what you want.
Thank you very much, you've been so much helpful
Since the quantization flow is only provided via the TFLiteConverter API, you will likely need to rewrite the Flatbuffer directly after quantization to achieve what you want.
Sorry to bother you again, I wasn't able to find how to implement the modification of a onnx or tflite via the flatbuffers as you suggested. Cen you explain better? Thank you very much in advance.
this function writes the operations name, i would like to modify the weights of a layer
1. Content and background
Conv
Conv
2. Summary of corrections
3. Before/After (If there is an operating log that can be used as a reference)
4. Issue number (only if there is a related issue)