ELS-RD / transformer-deploy

Efficient, scalable and enterprise-grade CPU/GPU inference server for 🤗 Hugging Face transformer models 🚀
https://els-rd.github.io/transformer-deploy/
Apache License 2.0
1.64k stars 149 forks source link

Installing pytorch-quantization #25

Closed vishalsrao closed 2 years ago

vishalsrao commented 2 years ago

I get the following error when pytorch-quantization is included in requirements.txt:

Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com
Collecting pytorch-quantization
  Downloading pytorch-quantization-0.0.1.dev5.tar.gz (7.9 kB)
  Preparing metadata (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /opt/conda/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-kmmchqi2/pytorch-quantization_5a45d9f46d524a108b6ec28eb5238500/setup.py'"'"'; __file__='"'"'/tmp/pip-install-kmmchqi2/pytorch-quantization_5a45d9f46d524a108b6ec28eb5238500/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-_58u5ior
       cwd: /tmp/pip-install-kmmchqi2/pytorch-quantization_5a45d9f46d524a108b6ec28eb5238500/
  Complete output (16 lines):
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-install-kmmchqi2/pytorch-quantization_5a45d9f46d524a108b6ec28eb5238500/setup.py", line 150, in <module>
      raise RuntimeError(open("ERROR.txt", "r").read())
  RuntimeError:
  ###########################################################################################
  The package you are trying to install is only a placeholder project on PyPI.org repository.
  This package is hosted on NVIDIA Python Package Index.

  This package can be installed as:

$ pip install nvidia-pyindex $ pip install pytorch-quantization

  ###########################################################################################

  ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/35/ea/c6c4ab73da4e36b9eddea7ff687b98e1bccb59bfb3bd0c24459914fb17f2/pytorch-quantization-0.0.1.dev5.tar.gz#sha256=4702207b088af5a1e58ee31d5ceee14aaa21bc3ef36b39ca996a6ee4d0ffb4dd (from https://pypi.org/simple/pytorch-quantization/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Downloading pytorch-quantization-0.0.1.dev4.tar.gz (4.1 kB)
  Preparing metadata (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /opt/conda/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-kmmchqi2/pytorch-quantization_b0afa379038d4cbc8e3d8b401f5d74f4/setup.py'"'"'; __file__='"'"'/tmp/pip-install-kmmchqi2/pytorch-quantization_b0afa379038d4cbc8e3d8b401f5d74f4/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-s1sedxj7
       cwd: /tmp/pip-install-kmmchqi2/pytorch-quantization_b0afa379038d4cbc8e3d8b401f5d74f4/
  Complete output (15 lines):
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-install-kmmchqi2/pytorch-quantization_b0afa379038d4cbc8e3d8b401f5d74f4/setup.py", line 150, in <module>
      raise RuntimeError(open("ERROR.txt", "r").read())
  RuntimeError:
  ###########################################################################################
  The package you are trying to install is only a placeholder project on PyPI.org repository.
  This package is hosted on NVIDIA Python Package Index.

  This package can be installed as:

$ pip install nvidia-pyindex $ pip install pytorch-quantization

  ###########################################################################################
  ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/d4/3e/e891628c040badc4d18ca48a28bf5a991654161fb32ee5f54ec2317e2664/pytorch-quantization-0.0.1.dev4.tar.gz#sha256=6fea1f1ba851353d65f08098fe19041cd045ca9239e98e5f7058cb1872b6ea57 (from https://pypi.org/simple/pytorch-quantization/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement pytorch-quantization (from versions: 0.0.1.dev4, 0.0.1.dev5)
ERROR: No matching distribution found for pytorch-quantization

I am testing this on pytorch/pytorch:1.10.0-cuda11.3-cudnn8-devel Docker container.

pommedeterresautee commented 2 years ago

What Python version are you using?

ghost commented 2 years ago

hi have you solved the problem. I met the same problem I use python 3.9 and cuda 11.3 pytorch 1.10 on windows

pommedeterresautee commented 2 years ago

I have found that depending of the OS it sometimes don't install from PiPy but is ok from repo directly. In a single command line it looks like:

pip3 install git+ssh://git@github.com/NVIDIA/TensorRT#egg=pytorch-quantization\&subdirectory=tools/pytorch-quantization/

I am not a Windows user and have not tried on it.

pommedeterresautee commented 2 years ago

closing as documentation now contain install instructions, etc. don't hesitate to reopen if it doesn't work for you.