Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import fast_rnnt is Failed #27

Open
jeff-lim opened this issue Aug 7, 2023 · 11 comments
Open

Import fast_rnnt is Failed #27

jeff-lim opened this issue Aug 7, 2023 · 11 comments

Comments

@jeff-lim
Copy link

jeff-lim commented Aug 7, 2023

Hi team,

I installed successfully with pip install fast_rnnt.
But can't import fast_rnnt (as attached img).

Here's my environment information.

  • Win11 / Python 3.11
  • CUDA 11.8 / torch 2.0.1
  • Also I tried install from source, but The import fast_rnnt is not work with same error message.
image
@jeff-lim
Copy link
Author

jeff-lim commented Aug 7, 2023

I think.. it is same issue to #17 . Is there're any updates or PR about this issue?

@csukuangfj
Copy link

Could you list the files in your python site-packages, especially the files whose name contains fast_rnnt?

@jeff-lim
Copy link
Author

jeff-lim commented Aug 7, 2023

there're only directories... It is okay....?

image

@jeff-lim
Copy link
Author

jeff-lim commented Aug 7, 2023

FYI tree of fast_rnnt, fast_rnnt-1.2.dist-info

fast_rnnt
image

fast_rnnt-1.2.dist-info
image

@csukuangfj
Copy link

Is there a file containing _fast_rnnt in its name?

@jeff-lim
Copy link
Author

jeff-lim commented Aug 7, 2023

no.. not at all. Actually I wondering the reason why from/import _fast_rnnt in the _init_.py, mutual_information.py

init.py GitRepo
from _fast_rnnt import with_cuda

mutual_information.py GitRepo
import _fast_rnnt

@csukuangfj
Copy link

After checking pypi.org, I am afraid you cannot use "pip install fast_rnnt" on Windows at pesent.

@jeff-lim
Copy link
Author

jeff-lim commented Aug 7, 2023

Oh my..
But, I also faced same issue, when I installed from source(git clone, python setup.py...), too.

Is it known issue to you/team?

  • If I install and run the code on Ubuntu, I will be okay to using fast_rnnt with cuda?

@csukuangfj
Copy link

csukuangfj commented Aug 7, 2023

Actually I wondering the reason why from/import _fast_rnnt in the init.py, mutual_information.py

I bet you have seen torch._C. If you don't know what _C is, please google it.

Similarly, we have _fast_rnnt, which is a Python extension module, implemented in C++/CUDA.


Is it known issue to you/team?

I just looked at the file setup.py and find that it does not support Windows.

Please use the following commands to build fast_rnnt for windows:

git clone https://github.com/k2-fsa/fast_rnnt
cd fast_rnnt
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build . --target _fast_rnnt --config Release

After running the above commands, please find the directory where _fast_rnnt*.pyd locates and add the directory to the environment variable PYTHONPATH.

Similarly, find the directory where mutual_information_core.dll locates and add it to the environment variable path.

Finally, add the directory /path/to/fast_rnnt/fast_rnnt/python to the environment variable PYTHONPATH.

Now you should be able to run python -c "import fast_rnnt".

@csukuangfj
Copy link

If I install and run the code on Ubuntu, I will be okay to using fast_rnnt with cuda?

Yes, I believe so.

@csukuangfj
Copy link

I think @pkufool will support installing fast_rnnt on Windows so that others won't have the same issue as yours.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants