-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
virtual void toC::Slice::resolve(): Assertion `false' failed. #47
Comments
Hi, The error in the title is just a convenience when building onnx2c for debugging (easier to stop with the debugger at the problem spot), and the default logging level is a bit verbose in the debug build... The real issue is on the previous line: As a general rule, onnx2c doesn't handle inference time defined tensor dimensions. This is because since the size of the tensor is not known at compile time, allocating the memory would have to be at run time, which would make the generated code less suitable for microcontrollers. Bert seems to be a language model - run time definitions of tensor sizes is probably pretty unavoidable when doing natural language procesing. I'm afraid there is nothing much to do here - onnx2c is probably the wrong tool for this. |
Excuse me, so this mean that the onnx2c tool cannot support operators related to tensor dimension changing well? I am using an onnx model with two convolutional layers, but I encountered this error, and it also generated a error with the concat dimension mismatch. Thank you. |
so can you recommend me some other tools that can achieve this function?Thank you very much. |
What is not implemented is having a tensor size depend on the values in the input data. If this is unavoidable in your application/NN design, then I guess you would need a bigger target system that could run e.g. onnx-runtime.
There is something strange here that I don't understand. For the Slice node, there is not much to do. |
Ok, clearly this problem is not related from the 'Slice' node :) And I don't see any reason for dynamic sized tensors here. Please open a new issue with either the .onnx file or the trace output ( |
Hi, I am trying to export BERT to C file but, unfortunately, i get the error in the title:
I am using Colab and i install onnx2c with the following snippet
Download the model weights from Huggingface
!wget https://huggingface.co/google-bert/bert-base-uncased/resolve/main/model.onnx
Convert to C
!./onnx2c model.onnx > bert-base-uncased.c
Last few lines of the ONNX2C LOG:
The text was updated successfully, but these errors were encountered: