flashlight / wav2letter

Facebook AI Research's Automatic Speech Recognition Toolkit
https://github.com/facebookresearch/wav2letter/wiki
Other
6.39k stars 1.01k forks source link

Building Python bindings: ModuleNotFoundError: No module named 'wav2letter._common' #391

Closed VaBezruchko closed 4 years ago

VaBezruchko commented 5 years ago

Hello.

I have some troubles with wav2letter package installation.

I used docker container image [Dockerfile-CPU] and built python bindings inside container with followings commands:

cd bindings/python pip install -e .

After pip installation i tried to run example examples/decoder_example.py but have got error ModuleNotFoundError: No module named 'wav2letter._common'.

Pip installation process was ended without any errors, Python package wav2letter was successfully built and located wav2letter/bindings/python.

What am I doing wrong?

0xjc commented 5 years ago

Hi VaBezruchko,

The Dockerfiles are not yet updated for building Python bindings (we are working on it). In particular -DCMAKE_POSITION_INDEPENDENT_CODE=ON is not yet specified for KenLM. I suspect that may be one of the issues.

I do not think that your pip install actually succeeded. Just to verify the issue, could you run pip install -e . --log <path_to_log_file> and search the log file for any errors?

tlikhomanenko commented 4 years ago

Current docker image supports python bindings, you could try to reproduce steps from Dockerfile to install and run example.

@VaBezruchko , Feel free to reopen if problem still exists.

wahyubram82 commented 4 years ago

The problem still exists...

I try: from wav2letter.common import Dictionary it will return error

after I investigate, I think it, the way we call the module change...

we should call it with this command:

`from wav2letter import common'

Dictionary = common.Dictionary

it's work with another way to call module:

`from wav2letter import criterion`

CriterionType = decoder.CriterionType
CpuViterbiPath = criterion.CpuViterbiPath
get_data_ptr_as_bytes = criterion.get_data_ptr_as_bytes
tlikhomanenko commented 4 years ago

Hi, thanks for pointing!

I redid the structure of modules when we merged flashlight with wav2letter, you can check now them here https://github.com/facebookresearch/flashlight/tree/master/bindings/python, probably there should be no this problem now.