microsoft / unilm

Large-scale Self-supervised Pre-training Across Tasks, Languages, and Modalities
https://aka.ms/GeneralAI
MIT License
19.64k stars 2.51k forks source link

Failing to install trocr on windows #1236

Open bit-scientist opened 1 year ago

bit-scientist commented 1 year ago

Model I am using (UniLM, MiniLM, LayoutLM ...): UniLM/trocr

I have seen similar issues but they don't seem to get resolved or addressed fully.

I am following the installation steps given here. It states that the following must be performed to install trocr:

conda create -n trocr python=3.7
conda activate trocr
git clone https://github.com/microsoft/unilm.git
cd unilm
cd trocr
pip install pybind11
pip install -r requirements.txt
pip install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" 'git+https://github.com/NVIDIA/apex.git'

Everything went smoothly until pip install -r requirements.txt where I got:

Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com
Looking in links: https://download.pytorch.org/whl/torch_stable.html, https://dl.fbaipublicfiles.com/detectron2/wheels/cu110/torch1.7/index.html
Collecting git+https://github.com/pytorch/fairseq.git (from -r requirements.txt (line 13))
  Cloning https://github.com/pytorch/fairseq.git to c:\users\user\appdata\local\temp\pip-req-build-0axplepa
  Running command git clone --filter=blob:none --quiet https://github.com/pytorch/fairseq.git 'C:\Users\user\AppData\Local\Temp\pip-req-build-0axplepa'
  Resolved https://github.com/pytorch/fairseq.git to commit 100cd91db19bb27277a06a25eb4154c805b10189
  Running command git submodule update --init --recursive -q
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 3221226505
  ╰─> [0 lines of output]
      [end of output]

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

× Getting requirements to build wheel did not run successfully.
│ exit code: 3221226505
╰─> See above for output.

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

I suspect the error is coming from the last line in requirements.txt git+https://github.com/pytorch/fairseq.git Because I also tried pip-installing the packages one at a time. A similar error occured after running pip install git+https://github.com/pytorch/fairseq.git. As I checked the github page, it states that it supports Python version >= 3.8 but we spefically created python 3.7 env. I am not sure it has anything to do with version mismatch but I still couldn't find any way out of this error.

I hope someone can help address this.

bit-scientist commented 1 year ago

@Dod-o, As you seem to be managing the TrOcr, may I have your attention please?