[英]How to use tf.keras.backend.ctc_decode in a sequential model?
[英]How can I install CTC-Decode?
我正在尝试在 windows 机器上安装 CTC-Decode。 ( https://github.com/parlance/ctcdecode )我在 Git Bash 中执行以下代码:
git clone --recursive https://github.com/parlance/ctcdecode.git cd ctcdecode && pip install.
我收到以下错误:
错误:由于 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'")]
我通过pip
安装时遇到了类似的问题,但与您不同的是,本地安装在我的情况下有效。 我在这个相关的 GH 问题中添加了我的方法(为了保持一致性,我也在下面复制粘贴它)。
我认识到这更像是一个疑难解答,而不是对您的问题的具体答案。 原因是安装脚本有几个硬编码的值,它们在不同的设置中可能会有很大差异。 事实上,如果你看一下上面的问题,许多不同的用户都有不同的问题,但都可能源于硬编码值的同一个问题。
出于这个原因,我不确定是否可以在不了解有关系统、依赖项等的许多详细信息的情况下判断哪个确切组合适用于给定设置,因此希望这可以帮助任何人解决问题并找到有效的组合。 如果您设法使其工作,请随时分享它,这可能是对 repo 的一个很好的补充。
干杯!
安德烈斯
就我而言(Ubuntu 20.04、Python3.7、torch 1.8),pip 安装也失败,但克隆并调用 pip 安装。 回购内部工作。
要在讨论中添加一些内容,您可能有兴趣检查此 repo 中的setup.py文件,该文件基本上是安装脚本。
其中,从这里下载并安装了几个压缩库。 解决您的问题的一个可能方法是用与您的设置更兼容的其他版本替换这些问题。
然后使用 g++ 命令编译库,您也可以在 setup.py 中找到该命令。 另一种可能的解决方法是使该命令适应您的设置。
以下在google colab中为我工作:
! git 克隆 --recursive https://github.com/parlance/ctcdecode.git ;
.cd;/ctcdecode/; \pip 安装 wget。 \python setup.py 安装
现在您可以导入 ctcdecode 而不会出错
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.