Comments (4)
A possible cause: microsoft/onnxconverter-common#271
If you find two Cast nodes linked like:
A walkaround is to remove extra Cast nodes like
import onnx
from onnxruntime.transformers.onnx_model import OnnxModel
onnx_model=OnnxModel(onnx.load("path/to/model_fp16.onnx"))
onnx_model.remove_cascaded_cast_nodes()
onnx_model.save_model_to_file("path/to/model_fp16_v2.onnx", use_external_data_format=False, all_tensors_to_one_file=True)
from onnxruntime.
@tianleiwu Thank you that comments me
I checked the cast nodes through netron app
and then I just executed what you said
However, It doesn't works for me sadly
this is "model_fp16_v2.onnx"
For reference, I think that onnxruntime or onnxconverter_common are not invalid.
Because other models are works well. except for the probelm models (the problem model is bigger than other models)
Do you have any hint can I do by anychance?
from onnxruntime.
Not every model can run in fp16. Sometime, some nodes need to upcast to fp32 to avoid overflow.
You can add --cmake_extra_defines onnxruntime_DEBUG_NODE_INPUTS_OUTPUTS=1
in build command line to build a package from source code. Set environment variable ORT_DEBUG_NODE_IO_DUMP_OUTPUT_DATA
to be 1 before running your application. In this way, you can see of output of each node. Compare the stdout of two runs (fp32 model vs fp16 model) can find out the root cause. See https://onnxruntime.ai/docs/build/eps.html#cuda for more information.
from onnxruntime.
okay Thank you reply @tianleiwu
I'll keep in track this problem and I will share with you if I found the reason why the model had didn't work
from onnxruntime.
Related Issues (20)
- ONNX Runtime doesn't support the graph optimization of vision-encoder-decoder yet HOT 1
- cannot resolve operator 'HardSwish' with opsets: ai.onnx v9 [Web] HOT 1
- cuda's FusedConv is not support Sigmod
- [Mobile] Subgraphs duplicate initializers in RAM during execution HOT 1
- [Web] The YOLOv8 segmentation model with batching option is not runing on the GPU ? HOT 2
- [Performance] Regression observed when using CUDA execution provider HOT 15
- Onnxruntime-directml 1.18.0 broken multithreading inference session HOT 3
- [Build] 0.18.0 release breaks Hummingbird build pipeline HOT 5
- Windows ARM64 & X64 CLIP Image Encoder different results HOT 2
- .. HOT 1
- [Feature Request] Get device ids via get_available_device_ids()
- [Training] IR version incompatibility in artifact generation for on-device training HOT 4
- npm install provides error on onnxruntime: 404 URL not found. HOT 2
- [Build] GCC Linker can't find re2 HOT 3
- [Web] `executionProviders` chain for `webnn` fallback does not work on init error HOT 28
- pip install failure for onnxruntime-gpu==1.9.0 HOT 5
- Get error while using Dml EP HOT 1
- ONNX I/O Binding HOT 5
- [Build] Support CUDA 12 onnxruntime-gpu pypi package HOT 9
- [Build] --external_graph_transformer_path doesn't. --test_external_transformer_example removed from build.py? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from onnxruntime.