Skip to content

Package for the automatic conversion between .h5 models to .onnx

Notifications You must be signed in to change notification settings

alesof/keras2onnx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

keras2onnx

Package for the automatic conversion between .h5 models to .onnx

Prerequisites

  1. tensorflow
  2. tf2onnx

Install

Clone this repository:

git clone https://github.com/alesof/keras2onnx.git

Install tf2onnx:

pip install -U tf2onnx
pip install onnx==1.14.1

Note: onnx 1.14.1 is necessary as tf2onnx install the 1.15 version which is not currently supported

How to convert .h5 model to .onnx

  1. Convert .h5 model to .pb model:
python keras2pb.py <path-to-model.h5> --verbose
  1. Convert .pb in .onnx:
python -m tf2onnx.convert --saved-model <path-to-generated-pb-model> --output <output-path\model-name.onnx>

Note keras2pb.py can also be launched in silent mode without --verbose

About

Package for the automatic conversion between .h5 models to .onnx

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages