Skip to content

neurala/onnx-simplifier

 
 

Repository files navigation

This repo is fork of original repo: https://github.com/daquexian/onnx-simplifier

Main issue in: onnx_simplifier.py

    # https://stackoverflow.com/a/60708339
    def parse_size(size: str) -> int:
        units = {"B": 1, "KB": 2**10, "MB": 2**20, "GB": 2**30, "TB": 2**40}
        size = size.upper()
        if not re.match(r' ', size):
            size = re.sub(r'([KMGT]?B)', r' \1', size)
        number, unit = [string.strip() for string in size.split()]
        return int(float(number)*units[unit])

Code snippet which is copied from stackoverflow, which creates license violation.

Quick instructions for building the wheel:

Download onnx-simplifier fork w/ the correct branch, including submodules
Ensure CMake is installed
Create virtual environment and run pip install . to install dependencies
Finally, run python setup.py bdist_wheel

If you receive an error regarding CMake version 3.5 not being supported by your version of CMake (which is likely if you're running a CMake version used to build the SDK), then setting the following variable should resolve any issue:

linux: export CMAKE_POLICY_VERSION_MINIMUM=3.5
powershell:$Env:CMAKE_POLICY_VERSION_MINIMUM=3.5

onnx-simplifier has a set of CMake files for itself, and one of the submodules is onnx and has a set of CMake files.

About

Simplify your onnx model

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 59.9%
  • Python 36.7%
  • CMake 2.9%
  • Shell 0.5%