简体   繁体   English

如何安装 CTC-Decode?

[英]How can I install CTC-Decode?

I am trying to install CTC-Decode on a windows machine.我正在尝试在 windows 机器上安装 CTC-Decode。 ( https://github.com/parlance/ctcdecode ) I am executing the following code in Git Bash: https://github.com/parlance/ctcdecode )我在 Git Bash 中执行以下代码:

git clone --recursive https://github.com/parlance/ctcdecode.git cd ctcdecode && pip install.

I get the following error:我收到以下错误:

ERROR: Could not install packages due to an EnvironmentError: [('C:\Users\vtz\ctcdecode\third_party\boost_1_67_0\libs\geometry\doc\html\geometry\reference\spatial_indexes\boost__geometry__index__rtree\rtree_parameters_type_const____indexable_getter_const____value_equal_const____allocator_type_const___.html', 'C:\Users\vtz\AppData\Local\Temp\pip-req-build-tb4918ru\third_party\boost_1_67_0\libs\geometry\doc\html\geometry\reference\spatial_indexes\boost__geometry__index__rtree\rtree_parameters_type_const____indexable_getter_const____value_equal_const____allocator_type_const___.html', "[Errno 2] No such file or directory: 'C:\\Users\\vtz\\AppData\\Local\\Temp\\pip-req-build-tb4918ru\\third_party\\boost_1_67_0\\libs\\geometry\\doc\\html\\geometry\\reference\\spatial_indexes\\boost__geometry__index__rtree\\rtree_parameters_type_const____indexable_getter_const____value_equal_const____allocator_type_const___.html'")]错误:由于 EnvironmentError 无法安装软件包:[('C:\Users\vtz\ctcdecode\third_party\boost_1_67_0\libs\geometry\doc\html\geometry\reference\spatial_indexes\boost__geometry__index__rtree\rtree_parameters_type_const____indexable_getter_const____value_equal_const____allocator_type_const___.html', 'C :\Users\vtz\AppData\Local\Temp\pip-req-build-tb4918ru\third_party\boost_1_67_0\libs\geometry\doc\html\geometry\reference\spatial_indexes\boost__geometry__index__rtree\rtree_parameters_type_const____indexable_getter_const____value_equal_const____allocator_type_const___.html', "[Err没有这样的文件或目录:'C:\\Users\\vtz\\AppData\\Local\\Temp\\pip-req-build-tb4918ru\\third_party\\boost_1_67_0\\libs\\geometry\\doc\\ html\\geometry\\reference\\spatial_indexes\\boost__geometry__index__rtree\\rtree_parameters_type_const____indexable_getter_const____value_equal_const____allocator_type_const___.html'")]

I had a similar issue installing via pip , but unlike you, the local installation worked in my case.我通过pip安装时遇到了类似的问题,但与您不同的是,本地安装在我的情况下有效。 I've added my approach in this related GH issue (I'm copypasting it also below for consistency).我在这个相关的 GH 问题中添加了我的方法(为了保持一致性,我也在下面复制粘贴它)。

I recognize that this is more of a troubleshooter than a specific answer to your problem.我认识到这更像是一个疑难解答,而不是对您的问题的具体答案。 The reason is that the installation script has several hardcoded values, and they may vary greatly among different setups.原因是安装脚本有几个硬编码的值,它们在不同的设置中可能会有很大差异。 In fact, if you look at the issue above, many different users have different problems, but all likely stem from the same problem with hardcoded values.事实上,如果你看一下上面的问题,许多不同的用户都有不同的问题,但都可能源于硬编码值的同一个问题。

For this reason I'm not sure if it's possible to tell which exact combination works for a given setup without knowing many details about system, dependencies, etc, so hopefully this helps anyone to navigate the issue and find a combination that works.出于这个原因,我不确定是否可以在不了解有关系统、依赖项等的许多详细信息的情况下判断哪个确切组合适用于给定设置,因此希望这可以帮助任何人解决问题并找到有效的组合。 feel free to share it if you manage to make it work, it could be a nice addition to the repo.如果您设法使其工作,请随时分享它,这可能是对 repo 的一个很好的补充。

Cheers!干杯!
Andres安德烈斯


Answer from GH issue: GH问题的答案:

In my case (Ubuntu 20.04, Python3.7, torch 1.8), pip install also failed but cloning and calling the pip install.就我而言(Ubuntu 20.04、Python3.7、torch 1.8),pip 安装也失败,但克隆并调用 pip 安装。 inside the repo worked.回购内部工作。

To add something to the discussion, you may be interested in checking the setup.py file in this repo, which is basically the installation script.要在讨论中添加一些内容,您可能有兴趣检查此 repo 中的setup.py文件,该文件基本上是安装脚本。

In it, several compressed libraries are downloaded from here and installed.其中,从这里下载并安装了几个压缩库。 A possible fix for your problems could be to replace those with other versions more compatible with your setup.解决您的问题的一个可能方法是用与您的设置更兼容的其他版本替换这些问题。

Then the libraries are compiled using a g++ command that you can also find inside setup.py.然后使用 g++ 命令编译库,您也可以在 setup.py 中找到该命令。 Another possible fix could be to adapt that command to your setup.另一种可能的解决方法是使该命令适应您的设置。

Below is worked for me in google colab:以下在google colab中为我工作:

Now you can import ctcdecode without an error现在您可以导入 ctcdecode 而不会出错

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM