microsoft / SpeechT5

Unified-Modal Speech-Text Pre-Training for Spoken Language Processing
MIT License
1.16k stars 113 forks source link

Speech2C training error #21

Closed Sreyan88 closed 1 year ago

Sreyan88 commented 1 year ago

Hi there,

Great repo and paper. I follow the exact installation and data prep steps for Speech2C training and get this error when I run the pre_training command:

AssertionError: number of labels does not match (5567 != 5566)

Any help would be appreciated!

Additionally, I also had to change:

dir: ./

in config and

common.user_dir=speech2c

to make the code work.

Sreyan88 commented 1 year ago

I was able to fix this error, however now I get a new error:

ImportError: cannot import name 'distributed_utils' from 'fairseq' (unknown location)
    from fairseq import distributed_utils, metrics
    from fairseq import distributed_utils, metrics
ImportError: cannot import name 'distributed_utils' from 'fairseq' (unknown location)
ImportError: cannot import name 'distributed_utils' from 'fairseq' (unknown location)
Traceback (most recent call last):
Ajyy commented 1 year ago

Hi, this looks like a fairseq installation problem, can you check whether your fairseq is installed successfully?

Sreyan88 commented 1 year ago

My sh file looks like this:

#!/usr/bin/env bash

DATA_DIR=/fs/nexus-scratch/sreyang/test/dataset/manifest
LABEL_DIR=/fs/nexus-scratch/sreyang/test/dataset/dump/100/kmeans_output
FAIRSEQ_PATH=/fs/nexus-scratch/sreyang/test/new/SpeechT5/Speech2C/fairseq

python ${FAIRSEQ_PATH}/fairseq_cli/hydra_train.py \
  --config-dir speech2c/config \
  --config-name speech2c_base_librispeech \
  task.data=${DATA_DIR} task.label_dir=${LABEL_DIR} task.labels='["km"]' \
  model.label_rate=100 common.user_dir=/fs/nexus-scratch/sreyang/test/new/SpeechT5/Speech2C/speech2c \

and I run it from:

/fs/nexus-scratch/sreyang/test/new/SpeechT5/Speech2C

which has two folders fairseq and speech2c. The installation looks fine, as data2vec training works fine. I even tried installing the latest fairseq version in the same folder.

Ajyy commented 1 year ago

The script looks ok.

You should be able to execute the code from fairseq import distributed_utils, metrics from any programs after installing the fairseq. This may not be a problem of Speech2C, but related to fairseq or your python environment.

Sreyan88 commented 1 year ago

Looks like moving speech2c folder to fairseq/examples worked for me. If this is actually needed, would please request you to update the readme!

Thank You for the help again!

Ajyy commented 1 year ago

Hi, thanks for your suggestions, but I did not get this error in my program... Anyway, glad to know that you fix this error!