-
Notifications
You must be signed in to change notification settings - Fork 115
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
Bug: ImportError: cannot import name 'get_class_name' from partially initialized module 'openspeech.utils' #116
Comments
I make sure that I have installed everything as follows: conda create -n acent_asr python=3.8 pip install --ignore-installed llvmlite install rnntgit clone https://github.com/1ytic/warp-rnnt #sudo mkdir /opt/miniconda/pkgs/ install apexcd apex pip install -e . |
I try 0.2.1 and find the code can run. so the bug is caused in 0.3.0 version (Master) |
After carefully checking the codes, I find that deleting from .models import OpenspeechModel from the openspeech/utils.py enable the normal running. Hope to fix the bug for other users :) |
I'll fix the bug. Thank you ! |
Hi, Thanks for your great codes.
I followed the readme to install the packages.
Torch 1.6.0
CUDA 10.1
Python 3.8
Code Branch: Master
And Run
DATASET_PATH=data/LibriSpeech_raw
MANIFEST_FILE_PATH=data/LibriSpeech_raw/openspeech/libri_character_manifest.txt
VOCAB_PARH=data/LibriSpeech_raw/openspeech/libri_labels.csv
CUDA_VISIBLE_DEVICES=1 python ./openspeech_cli/hydra_train.py
dataset=librispeech
dataset.dataset_download=True
dataset.dataset_path=$DATASET_PATH
dataset.manifest_file_path=$MANIFEST_FILE_PATH
tokenizer=libri_character
model=conformer_transducer
vocab_path=$VOCAB_PARH
audio=fbank
lr_scheduler=warmup_reduce_lr_on_plateau
trainer=gpu-fp16
criterion=transducer
And encounterd errors as below:
File "./openspeech_cli/hydra_train.py", line 30, in
from openspeech.tokenizers import TOKENIZER_REGISTRY
File "openspeech-main/openspeech/init.py", line 23, in
import openspeech.criterion
File "openspeech-main/openspeech/criterion/init.py", line 70, in
module = importlib.import_module(f"openspeech.criterion.{file}.{python_file}")
File "/home/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "openspeech-main/openspeech/criterion/ctc/ctc.py", line 29, in
from ...tokenizers.tokenizer import Tokenizer
File "openspeech-main/openspeech/tokenizers/init.py", line 69, in
module = importlib.import_module(f"openspeech.tokenizers.{file}.{tokenizer_name}")
File "/home/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "openspeech/tokenizers/librispeech/subword.py", line 28, in
from openspeech.datasets.librispeech.preprocess.subword import SENTENCEPIECE_MODEL_NAME
File "openspeech-main/openspeech/datasets/init.py", line 60, in
module = importlib.import_module(f"openspeech.datasets.{file}.{data_module_name}")
File "python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "openspeech-main/openspeech/datasets/aishell/lit_data_module.py", line 31, in
from openspeech.data.audio.dataset import SpeechToTextDataset
File "openspeech-main/openspeech/data/init.py", line 71, in
module = importlib.import_module(f"openspeech.data.audio.{file}.{module_name}")
File "/home/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "openspeech-main/openspeech/data/audio/mfcc/mfcc.py", line 28, in
from ....utils import LIBROSA_IMPORT_ERROR
File "openspeech-main/openspeech/utils.py", line 33, in
from .models import OpenspeechModel
File "openspeech-main/openspeech/models/init.py", line 27, in
from .openspeech_encoder_decoder_model import OpenspeechEncoderDecoderModel
File "openspeech-main/openspeech/models/openspeech_encoder_decoder_model.py", line 29, in
from openspeech.utils import get_class_name
ImportError: cannot import name 'get_class_name' from partially initialized module 'openspeech.utils' (most likely due to a circular import) (openspeech-main/openspeech/utils.py)
The text was updated successfully, but these errors were encountered: