Coder Social home page Coder Social logo

atlas_fcs_keras2onnx's Introduction

keras2onnx_fcs

A singularity container holds the required environment for keras2onnx. Please use with caution as this is untested (it appears to work, but I haven't checked the .onnx files that come out are well formed).

existing container

I have put a copy of the constructed container at /eos/atlas/atlascerngroupdisk/proj-simul/AF3_Run3/Jona/keras2onnx.sif. It's a large file though, so I anticipate that someone will delete it at some point.

building the container

If the file is gone, you can build a new one. The container requires sudo to build and is much easier to build on a linux box. You will need singularity installed; follow the instructions on the official webpage.

Then the build command is;

sudo singularity build keras2onnx.sif singularity.def

This takes the instructions from singularity.def and uses them to construct a container object. This process involves downloading an image of ubuntu and lots of packages, so expect it to take some time.

Running the container

The command to run the container has the form;

singularity run keras2onnx.sif /path/of/input/model_file.h5 /path/of/other_model.h5 --outputs /path/to/place/converted_model.onnx /path/to/place/other.onnx --custom /path/to/custom_objects.py

The --outputs flag is optional, if you don't provide it the output files will go to /path/of/input/model_file.h5.onnx (just getting .onnx appended to their path). The --custom flag is also optional, if given it should be the path to a python file containing the attribute custom_objects which is a dict of functions defining custom objects needed by tensorflow. If the --custom flag is not given, some default custom objects are passed.

For reasons that remain mysterious to me, the model you are trying to read from needs to be in your local directory, not in the eos directory. If it's in eos you will get an error like; OSError: SavedModel file does not exist at: /eos/path/to/your/model.h5{saved_model.pbtxt|saved_model.pb}, that doesn't necessarily mean you cannot read that .h5 file, just you need to move it somewhere else first. In the same manner, it will not write outputs to eos. There are examples of doing this in Convert.py. It doesn't seem to matter where the keras2onnx.sif is.

atlas_fcs_keras2onnx's People

Contributors

jbossios avatar

Watchers

James Cloos avatar

Forkers

keliuw19

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.