icefall/faqs.html

215 lines
16 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html class="writer-html5" lang="en">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Frequently Asked Questions (FAQs) &mdash; icefall 0.1 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=03e43079" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=e59714d7" />
<script src="_static/jquery.js?v=5d32c60e"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js?v=e031e9a9"></script>
<script src="_static/doctools.js?v=888ff710"></script>
<script src="_static/sphinx_highlight.js?v=4825356b"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Model export" href="model-export/index.html" />
<link rel="prev" title="Introduction" href="docker/intro.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="index.html" class="icon icon-home">
icefall
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="for-dummies/index.html">Icefall for dummies tutorial</a></li>
<li class="toctree-l1"><a class="reference internal" href="installation/index.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="docker/index.html">Docker</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Frequently Asked Questions (FAQs)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#oserror-libtorch-hip-so-cannot-open-shared-object-file-no-such-file-or-directory">OSError: libtorch_hip.so: cannot open shared object file: no such file or directory</a></li>
<li class="toctree-l2"><a class="reference internal" href="#attributeerror-module-distutils-has-no-attribute-version">AttributeError: module distutils has no attribute version</a></li>
<li class="toctree-l2"><a class="reference internal" href="#importerror-libpython3-10-so-1-0-cannot-open-shared-object-file-no-such-file-or-directory">ImportError: libpython3.10.so.1.0: cannot open shared object file: No such file or directory</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="model-export/index.html">Model export</a></li>
<li class="toctree-l1"><a class="reference internal" href="fst-based-forced-alignment/index.html">FST-based forced alignment</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="recipes/index.html">Recipes</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="contributing/index.html">Contributing</a></li>
<li class="toctree-l1"><a class="reference internal" href="huggingface/index.html">Huggingface</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="decoding-with-langugage-models/index.html">Decoding with language models</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">icefall</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">Frequently Asked Questions (FAQs)</li>
<li class="wy-breadcrumbs-aside">
<a href="https://github.com/k2-fsa/icefall/blob/master/docs/source/faqs.rst" class="fa fa-github"> Edit on GitHub</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="frequently-asked-questions-faqs">
<h1>Frequently Asked Questions (FAQs)<a class="headerlink" href="#frequently-asked-questions-faqs" title="Permalink to this heading"></a></h1>
<p>In this section, we collect issues reported by users and post the corresponding
solutions.</p>
<section id="oserror-libtorch-hip-so-cannot-open-shared-object-file-no-such-file-or-directory">
<h2>OSError: libtorch_hip.so: cannot open shared object file: no such file or directory<a class="headerlink" href="#oserror-libtorch-hip-so-cannot-open-shared-object-file-no-such-file-or-directory" title="Permalink to this heading"></a></h2>
<p>One user is using the following code to install <code class="docutils literal notranslate"><span class="pre">torch</span></code> and <code class="docutils literal notranslate"><span class="pre">torchaudio</span></code>:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>pip<span class="w"> </span>install<span class="w"> </span><span class="se">\</span>
<span class="w"> </span><span class="nv">torch</span><span class="o">==</span><span class="m">1</span>.10.0+cu111<span class="w"> </span><span class="se">\</span>
<span class="w"> </span><span class="nv">torchvision</span><span class="o">==</span><span class="m">0</span>.11.0+cu111<span class="w"> </span><span class="se">\</span>
<span class="w"> </span><span class="nv">torchaudio</span><span class="o">==</span><span class="m">0</span>.10.0<span class="w"> </span><span class="se">\</span>
<span class="w"> </span>-f<span class="w"> </span>https://download.pytorch.org/whl/torch_stable.html
</pre></div>
</div>
<p>and it throws the following error when running <code class="docutils literal notranslate"><span class="pre">tdnn/train.py</span></code>:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="ne">OSError</span><span class="p">:</span> <span class="n">libtorch_hip</span><span class="o">.</span><span class="n">so</span><span class="p">:</span> <span class="n">cannot</span> <span class="nb">open</span> <span class="n">shared</span> <span class="nb">object</span> <span class="n">file</span><span class="p">:</span> <span class="n">no</span> <span class="n">such</span> <span class="n">file</span> <span class="ow">or</span> <span class="n">directory</span>
</pre></div>
</div>
<p>The fix is to specify the CUDA version while installing <code class="docutils literal notranslate"><span class="pre">torchaudio</span></code>. That
is, change <code class="docutils literal notranslate"><span class="pre">torchaudio==0.10.0</span></code> to <code class="docutils literal notranslate"><span class="pre">torchaudio==0.10.0+cu11`</span></code>. Therefore,
the correct command is:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>pip<span class="w"> </span>install<span class="w"> </span><span class="se">\</span>
<span class="w"> </span><span class="nv">torch</span><span class="o">==</span><span class="m">1</span>.10.0+cu111<span class="w"> </span><span class="se">\</span>
<span class="w"> </span><span class="nv">torchvision</span><span class="o">==</span><span class="m">0</span>.11.0+cu111<span class="w"> </span><span class="se">\</span>
<span class="w"> </span><span class="nv">torchaudio</span><span class="o">==</span><span class="m">0</span>.10.0+cu111<span class="w"> </span><span class="se">\</span>
<span class="w"> </span>-f<span class="w"> </span>https://download.pytorch.org/whl/torch_stable.html
</pre></div>
</div>
</section>
<section id="attributeerror-module-distutils-has-no-attribute-version">
<h2>AttributeError: module distutils has no attribute version<a class="headerlink" href="#attributeerror-module-distutils-has-no-attribute-version" title="Permalink to this heading"></a></h2>
<p>The error log is:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Traceback</span> <span class="p">(</span><span class="n">most</span> <span class="n">recent</span> <span class="n">call</span> <span class="n">last</span><span class="p">):</span>
<span class="n">File</span> <span class="s2">&quot;./tdnn/train.py&quot;</span><span class="p">,</span> <span class="n">line</span> <span class="mi">14</span><span class="p">,</span> <span class="ow">in</span> <span class="o">&lt;</span><span class="n">module</span><span class="o">&gt;</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">asr_datamodule</span><span class="w"> </span><span class="kn">import</span> <span class="n">YesNoAsrDataModule</span>
<span class="n">File</span> <span class="s2">&quot;/home/xxx/code/next-gen-kaldi/icefall/egs/yesno/ASR/tdnn/asr_datamodule.py&quot;</span><span class="p">,</span> <span class="n">line</span> <span class="mi">34</span><span class="p">,</span> <span class="ow">in</span> <span class="o">&lt;</span><span class="n">module</span><span class="o">&gt;</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">icefall.dataset.datamodule</span><span class="w"> </span><span class="kn">import</span> <span class="n">DataModule</span>
<span class="n">File</span> <span class="s2">&quot;/home/xxx/code/next-gen-kaldi/icefall/icefall/__init__.py&quot;</span><span class="p">,</span> <span class="n">line</span> <span class="mi">3</span><span class="p">,</span> <span class="ow">in</span> <span class="o">&lt;</span><span class="n">module</span><span class="o">&gt;</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">.</span><span class="w"> </span><span class="kn">import</span> <span class="p">(</span>
<span class="n">File</span> <span class="s2">&quot;/home/xxx/code/next-gen-kaldi/icefall/icefall/decode.py&quot;</span><span class="p">,</span> <span class="n">line</span> <span class="mi">23</span><span class="p">,</span> <span class="ow">in</span> <span class="o">&lt;</span><span class="n">module</span><span class="o">&gt;</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">icefall.utils</span><span class="w"> </span><span class="kn">import</span> <span class="n">add_eos</span><span class="p">,</span> <span class="n">add_sos</span><span class="p">,</span> <span class="n">get_texts</span>
<span class="n">File</span> <span class="s2">&quot;/home/xxx/code/next-gen-kaldi/icefall/icefall/utils.py&quot;</span><span class="p">,</span> <span class="n">line</span> <span class="mi">39</span><span class="p">,</span> <span class="ow">in</span> <span class="o">&lt;</span><span class="n">module</span><span class="o">&gt;</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">torch.utils.tensorboard</span><span class="w"> </span><span class="kn">import</span> <span class="n">SummaryWriter</span>
<span class="n">File</span> <span class="s2">&quot;/home/xxx/tool/miniconda3/envs/yyy/lib/python3.8/site-packages/torch/utils/tensorboard/__init__.py&quot;</span><span class="p">,</span> <span class="n">line</span> <span class="mi">4</span><span class="p">,</span> <span class="ow">in</span> <span class="o">&lt;</span><span class="n">module</span><span class="o">&gt;</span>
<span class="n">LooseVersion</span> <span class="o">=</span> <span class="n">distutils</span><span class="o">.</span><span class="n">version</span><span class="o">.</span><span class="n">LooseVersion</span>
<span class="ne">AttributeError</span><span class="p">:</span> <span class="n">module</span> <span class="s1">&#39;distutils&#39;</span> <span class="n">has</span> <span class="n">no</span> <span class="n">attribute</span> <span class="s1">&#39;version&#39;</span>
</pre></div>
</div>
<p>The fix is:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>pip<span class="w"> </span>uninstall<span class="w"> </span>setuptools
pip<span class="w"> </span>install<span class="w"> </span><span class="nv">setuptools</span><span class="o">==</span><span class="m">58</span>.0.4
</pre></div>
</div>
</section>
<section id="importerror-libpython3-10-so-1-0-cannot-open-shared-object-file-no-such-file-or-directory">
<h2>ImportError: libpython3.10.so.1.0: cannot open shared object file: No such file or directory<a class="headerlink" href="#importerror-libpython3-10-so-1-0-cannot-open-shared-object-file-no-such-file-or-directory" title="Permalink to this heading"></a></h2>
<p>If you are using <code class="docutils literal notranslate"><span class="pre">conda</span></code> and encounter the following issue:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>Traceback (most recent call last):
File &quot;/k2-dev/yangyifan/anaconda3/envs/icefall/lib/python3.10/site-packages/k2-1.23.3.dev20230112+cuda11.6.torch1.13.1-py3.10-linux-x86_64.egg/k2/__init__.py&quot;, line 24, in &lt;module&gt;
from _k2 import DeterminizeWeightPushingType
ImportError: libpython3.10.so.1.0: cannot open shared object file: No such file or directory
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File &quot;/k2-dev/yangyifan/icefall/egs/librispeech/ASR/./pruned_transducer_stateless7_ctc_bs/decode.py&quot;, line 104, in &lt;module&gt;
import k2
File &quot;/k2-dev/yangyifan/anaconda3/envs/icefall/lib/python3.10/site-packages/k2-1.23.3.dev20230112+cuda11.6.torch1.13.1-py3.10-linux-x86_64.egg/k2/__init__.py&quot;, line 30, in &lt;module&gt;
raise ImportError(
ImportError: libpython3.10.so.1.0: cannot open shared object file: No such file or directory
Note: If you&#39;re using anaconda and importing k2 on MacOS,
you can probably fix this by setting the environment variable:
export DYLD_LIBRARY_PATH=$CONDA_PREFIX/lib/python3.10/site-packages:$DYLD_LIBRARY_PATH
</pre></div>
</div>
<p>Please first try to find where <code class="docutils literal notranslate"><span class="pre">libpython3.10.so.1.0</span></code> locates.</p>
<p>For instance,</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="nb">cd</span><span class="w"> </span><span class="nv">$CONDA_PREFIX</span>/lib
find<span class="w"> </span>.<span class="w"> </span>-name<span class="w"> </span><span class="s2">&quot;libpython*&quot;</span>
</pre></div>
</div>
<p>If you are able to find it inside <code class="docutils literal notranslate"><span class="pre">$CODNA_PREFIX/lib</span></code>, please set the
following environment variable:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="nb">export</span><span class="w"> </span><span class="nv">LD_LIBRARY_PATH</span><span class="o">=</span><span class="nv">$CONDA_PREFIX</span>/lib:<span class="nv">$LD_LIBRARY_PATH</span>
</pre></div>
</div>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="docker/intro.html" class="btn btn-neutral float-left" title="Introduction" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="model-export/index.html" class="btn btn-neutral float-right" title="Model export" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>&#169; Copyright 2021, icefall development team.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>