Skip to content
This repository has been archived by the owner on Aug 18, 2022. It is now read-only.

Latest commit

 

History

History

onnx-ecosystem

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

ONNX Converter Ecosystem Docker Container

About

This tool enables new users to quickly get started working with model conversions and inference in the ONNX model format.

By following the steps below, you will launch a pre-configured Jupyter Notebook environment and explore starter scripts for model conversion from various machine learning frameworks to the ONNX format, using ONNX Runtime for inference.

Supported Framework -> ONNX conversions

  • CoreML
  • Keras
  • SciKit-Learn
  • Tensorflow
  • PyTorch
  • LightGBM
  • CNTK
  • MXNet
  • Caffe (v1)
  • XGBoost (preview)
  • LibSVM (preview)

Usage

  1. Ensure that you have Docker installed, or are using Docker for Linux containers if on Windows.

  2. Obtain the ONNX ecosystem docker image. There are two ways to do this:

  • Pull the pre-built Docker image from DockerHub

    • docker pull onnx/onnx-ecosystem
  • Clone this repository. Navigate to the onnx-docker/onnx-ecosystem folder and build the image locally with the following command.

    • docker build . -t onnx/onnx-ecosystem
  1. Run the Docker container to launch a Jupyter notebook server. The -p argument forwards your local port 8888 to the exposed port 8888 for the Jupyter notebook environment in the container.

    • docker run -p 8888:8888 onnx/onnx-ecosystem
  2. Run docker ps in a separate terminal session to get the container name and verify your container is successfully running.

  3. Navigate to the url that the Jupyter Notebook is running on and use the provided token in the console.

    • Should be in the form: http://127.0.0.1:8888/?token=RANDOMSTRINGHERE
  4. Either upload a file using the Jupyter Notebook "Upload" button on the top right, or docker cp the required model files to the container.

    • docker cp PATH_TO_FILE CONTAINER_ID:/scripts/NAME_OF_FILE

    You can also copy a whole folder using docker.

    • docker cp PATH_TO_FOLDER/. CONTAINER_ID:/NAME_OF_FOLDER
  5. Navigate to the converter_scripts folder in the container and edit the appropriate notebook to convert your model to ONNX, or test the accuracy of the conversion using ONNX Runtime.

Contributing

This project welcomes contributions and suggestions. For details, please read through the contributor's guide and the ONNX Open Source Code of Conduct.

Acknowledgements

This container was based on an original ONNX Converter docker container from 2018. The updated ecosystem docker container is the result of the efforts of the ONNXMLTools team.

License

Apache License v2.0