GithubHelp home page GithubHelp logo

Comments (5)

yufenglee avatar yufenglee commented on May 23, 2024

@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.

guschmue avatar guschmue commented on May 23, 2024

To convert a tensorflow bert model, follow the instructions here:
https://gist.github.com/guschmue/9f2ba608414bef13fa67cdf278ca1e99

from onnxruntime.

WilliamTambellini avatar WilliamTambellini commented on May 23, 2024

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.

guschmue avatar guschmue commented on May 23, 2024

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.

WilliamTambellini avatar WilliamTambellini commented on May 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.