alibabasglab / MossFormer

This repo provides the processed samples of the manuscript "MossFormer: Pushing the Performance Limit of Monaural Speech Separation using Gated Single-head Transformer with Convolution-augmented Joint Self-Attentions", which was submitted to ICASSP 2023.
Apache License 2.0
84 stars 7 forks source link

在魔搭平台上使用训练脚本出现【SeparationTrainer: There is no such class as speechbrain.lobes.augment.TimeDomainSpecAugment】与【AttributeError: SeparationTrainer: 'ConfigDict' object has no attribute 'train'】问题 #5

Open A1yosa opened 3 months ago

A1yosa commented 3 months ago

2024-07-31 16:51:38,056 - modelscope - INFO - No subset_name specified, defaulting to the default 2024-07-31 16:51:38,962 - modelscope - WARNING - Reusing dataset dataset_builder (/mnt/workspace/.cache/modelscope/hub/datasets/modelscope/Libri2Mix_8k/master/data_files) 2024-07-31 16:51:38,963 - modelscope - INFO - Generating dataset dataset_builder (/mnt/workspace/.cache/modelscope/hub/datasets/modelscope/Libri2Mix_8k/master/data_files) 2024-07-31 16:51:38,963 - modelscope - INFO - Reusing cached meta-data file: /mnt/workspace/.cache/modelscope/hub/datasets/modelscope/Libri2Mix_8k/master/data_files/190787f97e8bd2b5d49f6ef99da02d31 Computing checksums: 100%|##########| 1/1 [00:05<00:00, 5.61s/it] 2024-07-31 16:51:47,597 - modelscope - INFO - No subset_name specified, defaulting to the default 2024-07-31 16:51:48,444 - modelscope - WARNING - Reusing dataset dataset_builder (/mnt/workspace/.cache/modelscope/hub/datasets/modelscope/Libri2Mix_8k/master/data_files) 2024-07-31 16:51:48,445 - modelscope - INFO - Generating dataset dataset_builder (/mnt/workspace/.cache/modelscope/hub/datasets/modelscope/Libri2Mix_8k/master/data_files) 2024-07-31 16:51:48,445 - modelscope - INFO - Reusing cached meta-data file: /mnt/workspace/.cache/modelscope/hub/datasets/modelscope/Libri2Mix_8k/master/data_files/dde55e0e7c1f0b279c727c9ebc836a24 2024-07-31 16:51:51,640 - modelscope - WARNING - Model revision not specified, use revision: v1.2.0 Downloading: 100%|██████████| 864/864 [00:00<00:00, 1.47kB/s] 2024-07-31 16:51:53,118 - modelscope - WARNING - Model revision not specified, use revision: v1.2.0 Downloading: 100%|██████████| 32.9k/32.9k [00:00<00:00, 68.5kB/s] Downloading: 100%|██████████| 32.9k/32.9k [00:00<00:00, 68.1kB/s] Downloading: 100%|██████████| 2.52k/2.52k [00:00<00:00, 4.73kB/s] Downloading: 100%|██████████| 161M/161M [00:01<00:00, 118MB/s]
Downloading: 100%|██████████| 176k/176k [00:00<00:00, 387kB/s] Downloading: 100%|██████████| 138k/138k [00:00<00:00, 211kB/s] Downloading: 100%|██████████| 39.9k/39.9k [00:00<00:00, 67.3kB/s] Downloading: 100%|██████████| 164k/164k [00:00<00:00, 328kB/s] Downloading: 100%|██████████| 11.3k/11.3k [00:00<00:00, 27.1kB/s] 2024-07-31 16:51:59,598 - modelscope - WARNING - Model revision not specified, use revision: v1.2.0 2024-07-31 16:52:00,142 - modelscope - INFO - initialize model from /mnt/workspace/.cache/modelscope/hub/damo/speech_mossformer_separation_temporal_8k 2024-07-31 16:52:06,504 - modelscope - INFO - cuda is not available, using cpu instead. ImportError: SeparationTrainer: There is no such class as speechbrain.lobes.augment.TimeDomainSpecAugment

A1yosa commented 3 months ago

2024-08-01 09:56:43,721 - modelscope - INFO - No subset_name specified, defaulting to the default 2024-08-01 09:56:44,355 - modelscope - WARNING - Reusing dataset dataset_builder (/mnt/workspace/.cache/modelscope/hub/datasets/modelscope/Libri2Mix_8k/master/data_files) 2024-08-01 09:56:44,355 - modelscope - INFO - Generating dataset dataset_builder (/mnt/workspace/.cache/modelscope/hub/datasets/modelscope/Libri2Mix_8k/master/data_files) 2024-08-01 09:56:44,356 - modelscope - INFO - Loading meta-data file ... 13901it [00:00, 56317.95it/s] 100% Computing checksums: 100%  1/1 [00:05<00:00,  5.59s/it] 2024-08-01 10:00:25,087 - modelscope - INFO - No subset_name specified, defaulting to the default 2024-08-01 10:00:25,919 - modelscope - WARNING - Reusing dataset dataset_builder (/mnt/workspace/.cache/modelscope/hub/datasets/modelscope/Libri2Mix_8k/master/data_files) 2024-08-01 10:00:25,919 - modelscope - INFO - Generating dataset dataset_builder (/mnt/workspace/.cache/modelscope/hub/datasets/modelscope/Libri2Mix_8k/master/data_files) 2024-08-01 10:00:25,920 - modelscope - INFO - Loading meta-data file ... 3001it [00:00, 17880.38it/s] 100% 2024-08-01 10:00:48,721 - modelscope - WARNING - Model revision not specified, use revision: v0.9.0 Downloading: 100%|██████████| 231/231 [00:00<00:00, 516B/s] 2024-08-01 10:00:49,866 - modelscope - WARNING - Model revision not specified, use revision: v0.9.0 Downloading: 100%|██████████| 138k/138k [00:00<00:00, 263kB/s] Downloading: 100%|██████████| 39.9k/39.9k [00:00<00:00, 95.6kB/s] Downloading: 100%|██████████| 213M/213M [00:01<00:00, 143MB/s]
Downloading: 100%|██████████| 2.85k/2.85k [00:00<00:00, 5.49kB/s] 2024-08-01 10:00:53,801 - modelscope - WARNING - Model revision not specified, use revision: v0.9.0 2024-08-01 10:00:54,159 - modelscope - INFO - initialize model from /mnt/workspace/.cache/modelscope/hub/damo/speech_mossformer2_separation_temporal_8k 2024-08-01 10:00:54,512 - modelscope - INFO - cuda is not available, using cpu instead. AttributeError: SeparationTrainer: 'ConfigDict' object has no attribute 'train'

AttributeError Traceback (most recent call last) File /usr/local/lib/python3.10/site-packages/modelscope/utils/registry.py:212, in build_from_cfg(cfg, registry, group_key, default_args) 211 else: --> 212 return obj_cls(**args) 213 except Exception as e: 214 # Normal TypeError does not print class name.

File /usr/local/lib/python3.10/site-packages/modelscope/trainers/audio/separation_trainer.py:82, in SeparationTrainer.init(self, model, work_dir, cfg_file, train_dataset, eval_dataset, model_revision, **kwargs) 80 if 'max_epochs' not in kwargs: 81 assert hasattr( ---> 82 self.cfg.train, 'max_epochs' 83 ), 'max_epochs is missing from the configuration file' 84 self._max_epochs = self.cfg.train.max_epochs

File /usr/local/lib/python3.10/site-packages/modelscope/utils/config.py:297, in Config.getattr(self, name) 296 def getattr(self, name): --> 297 return getattr(self._cfg_dict, name)

File /usr/local/lib/python3.10/site-packages/modelscope/utils/config.py:53, in ConfigDict.getattr(self, name) 52 return value ---> 53 raise ex

AttributeError: 'ConfigDict' object has no attribute 'train'

During handling of the above exception, another exception occurred:

AttributeError Traceback (most recent call last) Cell In[1], line 34 22 eval_dataset = MsDataset.load( 23 'Libri2Mix_8k', split='validation').to_torch_dataset(preprocessors=[ 24 AudioBrainPreprocessor(takes='mix_wav:FILE', provides='mix_sig'), (...) 27 ], 28 to_tensor=False) 29 kwargs = dict( 30 model='damo/speech_mossformer2_separation_temporal_8k', 31 train_dataset=train_dataset, 32 eval_dataset=eval_dataset, 33 work_dir=work_dir) ---> 34 trainer = build_trainer( 35 Trainers.speech_separation, default_args=kwargs) 36 trainer.train()

File /usr/local/lib/python3.10/site-packages/modelscope/trainers/builder.py:39, in build_trainer(name, default_args) 36 register_plugins_repo(configuration.safe_get('plugins')) 37 register_modelhub_repo(model_dir, 38 configuration.get('allow_remote', False)) ---> 39 return build_from_cfg(cfg, TRAINERS, default_args=default_args)

File /usr/local/lib/python3.10/site-packages/modelscope/utils/registry.py:215, in build_from_cfg(cfg, registry, group_key, default_args) 212 return obj_cls(**args) 213 except Exception as e: 214 # Normal TypeError does not print class name. --> 215 raise type(e)(f'{obj_cls.name}: {e}')

AttributeError: SeparationTrainer: 'ConfigDict' object has no attribute 'train'

szhang-hub commented 3 months ago

Hi, @A1yosa.I'm facing the same problem as you. Have you found a solution?

szhang-hub commented 3 months ago

I changed my speechbrain version from 1.0.0 to 0.5.7, and the issuse was solved successfully.You can refer https://speechbrain.readthedocs.io/en/0.5.7/API/speechbrain.lobes.augment.html#speechbrain.lobes.augment.SpecAugment