daquexian / onnx-simplifier

Simplify your onnx model
Apache License 2.0
3.67k stars 377 forks source link

[BUG] I can't install onnx-simplifier on Jetson AGX orin #286

Closed storm12t48 closed 1 year ago

storm12t48 commented 1 year ago

I try every version same issues error installing this package on Jetson AGx orin 32 gb

Discarding https://files.pythonhosted.org/packages/1e/a8/de6f65f50ac5c457f0a0fe1de8802f681b0c20650e0db23560a675319f71/onnx-simplifier-0.4.13.tar.gz (from https://pypi.org/simple/onnx-simplifier/) (requires-python:>=3.6): Requested onnxsim from https://files.pythonhosted.org/packages/1e/a8/de6f65f50ac5c457f0a0fe1de8802f681b0c20650e0db23560a675319f71/onnx-simplifier-0.4.13.tar.gz (from super-gradients) has inconsistent name: expected 'onnx-simplifier', but metadata has 'onnxsim'
  Downloading onnx-simplifier-0.4.10.tar.gz (18.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 18.1/18.1 MB 13.4 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [40 lines of output]
      fatal: not a git repository (or any of the parent directories): .git
      fatal: not a git repository (or any of the parent directories): .git
      WARNING: The directory '/root/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.
      /usr/lib/python3.8/site-packages/setuptools/__init__.py:84: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
      !!

              ********************************************************************************
              Requirements should be satisfied by a PEP 517 installer.
              If you are using pip, you can try `pip install --use-pep517`.
              ********************************************************************************

      !!
        dist.fetch_build_eggs(dist.setup_requires)
      Traceback (most recent call last):
        File "/usr/lib/python3.8/site-packages/setuptools/_normalization.py", line 59, in safe_version
          return str(packaging.version.Version(v))
        File "/usr/lib/python3.8/site-packages/setuptools/_vendor/packaging/version.py", line 197, in __init__
          raise InvalidVersion(f"Invalid version: '{version}'")
      setuptools.extern.packaging.version.InvalidVersion: Invalid version: 'unknown'

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-empzrljp/onnx-simplifier_571beb5c6f0641ebab4dd873e8819db8/setup.py", line 271, in <module>
          setuptools.setup(
        File "/usr/lib/python3.8/site-packages/setuptools/__init__.py", line 107, in setup
          return distutils.core.setup(**attrs)
        File "/usr/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 147, in setup
          _setup_distribution = dist = klass(attrs)
        File "/usr/lib/python3.8/site-packages/setuptools/dist.py", line 491, in __init__
          self.patch_missing_pkg_info(attrs)
        File "/usr/lib/python3.8/site-packages/setuptools/dist.py", line 480, in patch_missing_pkg_info
          dist._version = _normalization.safe_version(str(attrs['version']))
        File "/usr/lib/python3.8/site-packages/setuptools/_normalization.py", line 62, in safe_version
          return str(packaging.version.Version(attempt))
        File "/usr/lib/python3.8/site-packages/setuptools/_vendor/packaging/version.py", line 197, in __init__
          raise InvalidVersion(f"Invalid version: '{version}'")
      setuptools.extern.packaging.version.InvalidVersion: Invalid version: 'unknown'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.
CNOCycle commented 1 year ago

Actually, the issue about unknown version has been fixed since v0.4.11. You can simply install onnxsim using the command pip3 install onnxsim on arm architecture without any problem. If you would like to install previous version, you need to build the package from the source code. The details can be fond in this linke.

storm12t48 commented 1 year ago

Honestly, it always gives me the same errors with pip3 install onnxsim (cf picture) even on an nvidia container with onnxruntime normally which should work

Screenshot from 2023-05-12 07-51-00

but rebuild setup work with v0.4.28 thx you

Screenshot from 2023-05-12 08-11-50