yeyupiaoling / PPASR

基于PaddlePaddle实现端到端中文语音识别,从入门到实战,超简单的入门案例,超实用的企业项目。支持当前最流行的DeepSpeech2、Conformer、Squeezeformer模型
Apache License 2.0
797 stars 131 forks source link

TypeError: object of type 'NoneType' has no len() 感谢感谢 #172

Closed iaomeng closed 5 months ago

iaomeng commented 6 months ago

(tf) C:\Users\zhou\PPASR>python create_data.py D:\anacondas3\envs\tf\lib\site-packages\paddleaudio_extension.py:141: UserWarning: paddleaudio C++ extension is not available. sox_io, sox_effect, kaldi raw feature is not supported!!! warnings.warn( [2024-01-23 06:30:45 INFO ] utils:print_arguments:15 - ----------- 额外配置参数 ----------- [2024-01-23 06:30:45 INFO ] utils:print_arguments:17 - annotation_path: dataset/annotation/ [2024-01-23 06:30:45 INFO ] utils:print_arguments:17 - configs: configs/conformer.yml [2024-01-23 06:30:45 INFO ] utils:print_arguments:17 - count_threshold: 2 [2024-01-23 06:30:45 INFO ] utils:print_arguments:17 - is_change_frame_rate: False [2024-01-23 06:30:45 INFO ] utils:print_arguments:17 - is_merge_audio: False [2024-01-23 06:30:45 INFO ] utils:print_arguments:17 - max_duration: 600 [2024-01-23 06:30:45 INFO ] utils:print_arguments:17 - max_test_manifest: 10000 [2024-01-23 06:30:45 INFO ] utils:print_arguments:17 - noise_path: dataset/audio/noise [2024-01-23 06:30:45 INFO ] utils:print_arguments:17 - num_samples: 1000000 [2024-01-23 06:30:45 INFO ] utils:print_arguments:17 - num_workers: 8 [2024-01-23 06:30:45 INFO ] utils:print_arguments:17 - only_keep_zh_en: True [2024-01-23 06:30:45 INFO ] utils:print_arguments:17 - save_audio_path: dataset/audio/merge_audio [2024-01-23 06:30:45 INFO ] utils:print_arguments:18 - ------------------------------------------------ [2024-01-23 06:30:45 INFO ] utils:print_arguments:20 - ----------- 配置文件参数 ----------- [2024-01-23 06:30:45 INFO ] utils:print_arguments:23 - ctc_beam_search_decoder_conf: [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - alpha: 2.2 [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - beam_size: 300 [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - beta: 4.3 [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - cutoff_prob: 0.99 [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - cutoff_top_n: 40 [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - language_model_path: lm/zh_giga.no_cna_cmn.prune01244.klm [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - num_processes: 10 [2024-01-23 06:30:45 INFO ] utils:print_arguments:23 - dataset_conf: [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - batch_size: 16 [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - dataset_vocab: dataset/vocabulary.txt [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - manifest_type: txt [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - max_duration: 20 [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - mean_istd_path: dataset/mean_istd.json [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - min_duration: 0.5 [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - noise_manifest_path: dataset/manifest.noise [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - num_workers: 4 [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - prefetch_factor: 2 [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - test_manifest: dataset/manifest.test [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - train_manifest: dataset/manifest.train [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - use_shared_memory: True [2024-01-23 06:30:45 INFO ] utils:print_arguments:32 - decoder: ctc_beam_search [2024-01-23 06:30:45 INFO ] utils:print_arguments:23 - decoder_conf: [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - attention_heads: 4 [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - dropout_rate: 0.1 [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - linear_units: 1024 [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - num_blocks: 3 [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - positional_dropout_rate: 0.1 [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - r_num_blocks: 3 [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - self_attention_dropout_rate: 0.1 [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - src_attention_dropout_rate: 0.1 [2024-01-23 06:30:45 INFO ] utils:print_arguments:23 - encoder_conf: [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - activation_type: swish [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - attention_dropout_rate: 0.1 [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - attention_heads: 4 [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - cnn_module_kernel: 15 [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - dropout_rate: 0.1 [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - input_layer: conv2d [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - linear_units: 2048 [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - normalize_before: True [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - num_blocks: 12 [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - output_size: 256 [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - pos_enc_layer_type: rel_pos [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - positional_dropout_rate: 0.1 [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - use_cnn_module: True [2024-01-23 06:30:45 INFO ] utils:print_arguments:32 - metrics_type: cer [2024-01-23 06:30:45 INFO ] utils:print_arguments:23 - model_conf: [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - ctc_weight: 0.3 [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - length_normalized_loss: False [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - lsm_weight: 0.1 [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - reverse_weight: 0.3 [2024-01-23 06:30:45 INFO ] utils:print_arguments:23 - optimizer_conf: [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - learning_rate: 0.001 [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - optimizer: Adam [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - scheduler: WarmupLR [2024-01-23 06:30:45 INFO ] utils:print_arguments:26 - scheduler_conf: [2024-01-23 06:30:45 INFO ] utils:print_arguments:28 - min_lr: 1e-05 [2024-01-23 06:30:45 INFO ] utils:print_arguments:28 - warmup_steps: 25000 [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - weight_decay: 1e-06 [2024-01-23 06:30:45 INFO ] utils:print_arguments:23 - preprocess_conf: [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - feature_method: fbank [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - n_mels: 80 [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - n_mfcc: 40 [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - sample_rate: 16000 [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - target_dB: -20 [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - use_dB_normalization: True [2024-01-23 06:30:45 INFO ] utils:print_arguments:32 - streaming: True [2024-01-23 06:30:45 INFO ] utils:print_arguments:23 - train_conf: [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - accum_grad: 4 [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - enable_amp: False [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - grad_clip: 5.0 [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - log_interval: 100 [2024-01-23 06:30:45 INFO ] utils:print_arguments:30 - max_epoch: 200 [2024-01-23 06:30:45 INFO ] utils:print_arguments:32 - use_model: conformer [2024-01-23 06:30:45 INFO ] utils:print_arguments:33 - ------------------------------------------------ [2024-01-23 06:30:45 INFO ] trainer:create_data:399 - 开始生成数据列表... 0it [00:00, ?it/s] [2024-01-23 06:30:45 INFO ] utils:create_manifest:144 - 完成生成数据列表,数据集总长度为0.00小时! [2024-01-23 06:30:45 INFO ] trainer:create_data:407 - ====================================================================== [2024-01-23 06:30:45 INFO ] trainer:create_data:408 - 开始生成噪声数据列表... [2024-01-23 06:30:45 INFO ] utils:create_noise:252 - 噪声音频文件为空,已跳过! [2024-01-23 06:30:45 INFO ] trainer:create_data:413 - ====================================================================== [2024-01-23 06:30:45 INFO ] trainer:create_data:415 - 开始生成数据字典... 0it [00:00, ?it/s] 0it [00:00, ?it/s] [2024-01-23 06:30:45 INFO ] trainer:create_data:429 - 数据字典生成完成! [2024-01-23 06:30:45 INFO ] trainer:create_data:431 - ====================================================================== [2024-01-23 06:30:45 INFO ] normalizer:compute_mean_istd:62 - 开始抽取0条数据计算均值和标准值... D:\anacondas3\envs\tf\lib\site-packages\paddle\io\reader.py:429: UserWarning: DataLoader with multi-process mode is not supported on MacOs and Windows currently. Please use signle-process mode with num_workers = 0 instead warnings.warn( 0it [00:00, ?it/s] Traceback (most recent call last): File "create_data.py", line 28, in trainer.create_data(annotation_path=args.annotation_path, File "C:\Users\zhou\PPASR\ppasr\trainer.py", line 433, in create_data normalizer.compute_mean_istd(manifest_path=self.configs.dataset_conf.train_manifest, File "C:\Users\zhou\PPASR\ppasr\data_utils\normalizer.py", line 80, in compute_mean_istd for i in range(len(means)): TypeError: object of type 'NoneType' has no len()

yeyupiaoling commented 6 months ago

数据列表没有数据