unilm 无法在Windows上安装trocr

xmd2e60i  于 2个月前  发布在  Windows
关注(0)|答案(1)|浏览(48)

我正在使用的模型(UniLM,MiniLM,LayoutLM等):UniLM/trocr

我已经遇到了类似的问题,但似乎没有得到解决或充分解决。

我正在按照here给出的安装步骤进行操作。它指出在安装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'

一切都进行得很顺利,直到pip install -r requirements.txt,我得到了:

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.

我怀疑错误来自requirements.txt中的最后一行git+https://github.com/pytorch/fairseq.git。因为我也尝试逐个使用pip安装这些包。在运行pip install git+https://github.com/pytorch/fairseq.git后出现了类似的错误。当我检查github page时,它指出它支持Python版本>= 3.8,但我们特别创建了Python 3.7环境。我不确定这是否与版本不匹配有关,但我仍然找不到解决这个错误的方法。
我希望有人能帮助解决这个问题。

drkbr07n

drkbr07n1#

Dod-o,你似乎在管理TrOcr,请允许我请你注意一下?

相关问题