unilm ERROR in TROCR installation

eivnm1vs  于 2个月前  发布在  其他
关注(0)|答案(3)|浏览(31)

在Ubuntu 20.04上安装trocr,按照https://github.com/microsoft/unilm/tree/master/trocr上的trocr安装步骤进行:

conda create -n trocr python=3.7
conda activate trocr
git clone [https://github.com/microsoft/unilm.git](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](https://github.com/NVIDIA/apex.git) '

一切顺利,直到运行trocr的安装脚本时遇到了以下错误:

INFO: pip正在查看多个fastwer版本以确定哪个版本与其他要求兼容。这可能需要一段时间。
Collecting fastwer
使用缓存的fastwer-0.1.tar.gz (3.6 kB)
准备元数据(setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
 exit code: 1
 ╰─> [6行输出]
Traceback (most recent call last):
 File "", line 36, in 
 File "", line 34, in 
 File "/tmp/pip-install-p201j4px/fastwer_063feafc5a6f4f29a4b5e94054f4c21a/setup.py", line 93, in 
 with open('LICENSE') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'LICENSE'
[end of output]
注意:此错误源于子进程,很可能不是pip的问题。
错误:元数据生成失败
× 在生成包元数据时遇到错误。
 ╰─> 请参阅上面的输出。
注意:这是上面提到的包的问题,而不是pip的问题。
提示:请参阅上面的详细信息。

我在网上搜索了可能的解决方案,但没有看到任何内容。我将pip升级到了22.1.2版本。

dba5bblo

dba5bblo1#

作为临时的解决方案,你可以:

  • 安装fastwer的新版本(我对0.1.3没有问题)
  • 从requirements.txt中删除pytorch、torchvision和timm的特定版本

我至少能够拉取并设置环境(如果有人想在Windows下使用它:以root身份打开PowerShell,或者使用带有最新gcc版本的WSL)
编辑:不需要使用旧版本的fairseq

2ledvvac

2ledvvac2#

你好,@dka-lmis,我知道已经过去一年了。希望这对你仍然有帮助😃
我已经按照你的建议做了,但仍然出现了相同的错误。你能分享一下你的requirements.txt文件供参考吗?
现在,我正在尝试逐一安装依赖项,所以如果能知道你在那里使用的依赖项版本也很好。谢谢!

相关问题