Comments (5)
@jayjaywg the input shape:{70,767} is for operator reshape, not the model input. I guess there may be something wrong with the converter. Could you please share the model to @pengwa and @guschmue ? Or log an issue in https://github.com/onnx/tensorflow-onnx instead?
from onnxruntime.
To convert a tensorflow bert model, follow the instructions here:
https://gist.github.com/guschmue/9f2ba608414bef13fa67cdf278ca1e99
from onnxruntime.
Hi @guschmue
Could you please precise what you mean by :
"We want to use placeholders but the TpuEstimator used in run_squad.py doesn't support this,
we require a small change in run_squad.py / model_fn_builder to pass in a argument to a flag
to use TpuEstimator or standard Estimator."
in export_to_saved_model.py ?
Kind
from onnxruntime.
Sorry, did not get a notify for the question.
This comment in export_to_saved_model.py - we want the input to be a Placeholder when we export the model as saved_model but with the TpuEstimator that is used in bert that doesn't work so in export_to_saved_model.py (which is mostly a copy of run_squad.py) I replaced the TpuEstimator with a normal Estimator. This is the code in if USE_TPU_ESTIMATOR
from onnxruntime.
Ok thanks. So perhaps the error I encounter is unrelated to that comment :
INFO:tensorflow:Done calling model_fn.
Traceback (most recent call last):
File "../export_to_saved_model.py", line 113, in
tf.app.run()
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/platform/app.py", line 125, in run
_sys.exit(main(argv))
File "../export_to_saved_model.py", line 108, in main
serving_input_receiver_fn=serving_input_receiver_fn)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/estimator/estimator.py", line 663, in export_savedmodel
mode=model_fn_lib.ModeKeys.PREDICT)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/estimator/estimator.py", line 789, in _export_saved_model_for_mode
strip_default_attrs=strip_default_attrs)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/estimator/estimator.py", line 907, in _export_all_saved_models
mode=model_fn_lib.ModeKeys.PREDICT)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/estimator/estimator.py", line 984, in _add_meta_graph_for_mode
config=self.config)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/estimator/estimator.py", line 1199, in _call_model_fn
raise ValueError('model_fn should return an EstimatorSpec.')
ValueError: model_fn should return an EstimatorSpec.
TBC. Tks.
from onnxruntime.
Related Issues (20)
- I want to get the“hidden_states” data in the Bert model HOT 3
- [Build] TVM EP Build HOT 1
- BeamSearch op returning wrong results on CUDA execution provider when sequence is used as input_ids HOT 1
- [Documentation] ORT Format Model Version Table Needs Update HOT 2
- [Mobile] Broadcasting Error in Sub Node with ONNX Runtime Version 1.17.3: Incompatibility with Dimension Broadcasting Rules
- Type Error: Type 'tensor(int64)' of input parameter (16586) of operator (Clip) in node (Clip_13292) is invalid. HOT 4
- LayerNormalization doesnt' work as expected in MAC.
- User-provided session logging function is not used for every log HOT 4
- NOT_IMPLEMENTED : Could not find an implementation for ReduceProd(18) node with name 'p2o.ReduceProd.0'
- [Performance] Quadratic behaviour in list operations with SequenceInsert in onnx
- [Build] [CANN] Failed to build CANN provider with training and Python bindings
- ONNX Runtime doesn't support the graph optimization of vision-encoder-decoder yet
- cannot resolve operator 'HardSwish' with opsets: ai.onnx v9 [Web]
- 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 operating on the GPU ?
- [Performance] Regression observed when using CUDA execution provider HOT 2
- Onnxruntime-directml 1.18.0 broken multithreading inference session HOT 1
- [Build] 0.18.0 release breaks Hummingbird build pipeline HOT 4
- Windows ARM64 & X64 CLIP Image Encoder different results 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.