mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-06-04 23:59:56 +00:00
replace onnxmltools by keras-onnx in one example (#1151)
This commit is contained in:
parent
d8ac0d64d0
commit
d33dbb23b2
1 changed files with 2 additions and 2 deletions
|
|
@ -14,7 +14,7 @@ of a pretrained deep learning model obtained from
|
|||
with *onnxruntime*. The conversion requires
|
||||
`keras <https://keras.io/>`_,
|
||||
`tensorflow <https://www.tensorflow.org/>`_,
|
||||
`sklearn-onnx <https://github.com/onnx/sklearn-onnx/>`_,
|
||||
`keras-onnx <https://github.com/onnx/keras-onnx/>`_,
|
||||
`onnxmltools <https://pypi.org/project/onnxmltools/>`_
|
||||
but then only *onnxruntime* is required
|
||||
to compute the predictions.
|
||||
|
|
@ -24,7 +24,7 @@ if not os.path.exists('dense121.onnx'):
|
|||
from keras.applications.densenet import DenseNet121
|
||||
model = DenseNet121(include_top=True, weights='imagenet')
|
||||
|
||||
from onnxmltools import convert_keras
|
||||
from keras2onnx import convert_keras
|
||||
onx = convert_keras(model, 'dense121.onnx')
|
||||
with open("dense121.onnx", "wb") as f:
|
||||
f.write(onx.SerializeToString())
|
||||
|
|
|
|||
Loading…
Reference in a new issue