openspeech-team / openspeech

Open-Source Toolkit for End-to-End Speech Recognition leveraging PyTorch-Lightning and Hydra.
https://openspeech-team.github.io/openspeech/
MIT License
670 stars 112 forks source link

Import error of pytorch_lightning LightningLoggerBase #212

Closed DevTae closed 10 months ago

DevTae commented 10 months ago

Environment info

Information

Model I am using (ListenAttendSpell, Transformer, Conformer ...): conformer_lstm

The problem arises when using:

To reproduce

Steps to reproduce the behavior:

  1. install conda and activate env
  2. bash install.sh (in openspeech)
  3. python ./bin/generate_openspeech_configs.py
  4. error occured.
python3 ./openspeech_cli/hydra_train.py dataset=ksponspeech dataset.dataset_path=/workspace/data dataset.manifest_file_path=/workspace/data/transcripts.txt tokenizer=kspon_character model=conformer_lstm audio=fbank lr_scheduler=warmup_reduce_lr_on_plateau trainer=gpu criterion=cross_entropy
ImportError: cannot import name 'LightningLoggerBase' from 'pytorch_lightning.loggers' (/root/anaconda3/envs/mirae/lib/python3.8/site-packages/pytorch_lightning/loggers/__init__.py)

Expected behavior

DevTae commented 10 months ago

If pytorch lightning version is above 1.9.0, you should downgrade your lightning library.

I downloaded libraries using pip as like that :

(pip_list.txt)

astropy==5.1
hydra-core==1.0.7
Levenshtein==0.20.5
librosa==0.9.2
omegaconf==2.0.6
pandas==1.5.0
pytorch-lightning==1.6.0
tokenizers==0.12.1
torch==1.13.1
torchaudio==0.13.1
torchmetrics==0.6.0
torchvision==0.14.1
tqdm==4.64.1
sentencepiece==0.1.99
wandb==0.15.12

Also, you have not to download newer torch version when you executes install.sh:25L. I recommend to comment the line of installing torch, torchaudio.

Then,

  1. pip install -r pip_list.txt
  2. bash install.sh
  3. you could use openspeech normally

Thanks.