m3hrdadfi / soxan

Wav2Vec for speech recognition, classification, and audio classification
Apache License 2.0
245 stars 35 forks source link

'Wav2Vec2FeatureExtractor' object has no attribute 'feature_extractor' #13

Closed freds0 closed 2 years ago

freds0 commented 2 years ago

When running wav2vec training using my dataset, the following problem occurred, on line 296 of the run_wav2vec_clf.py script:

Traceback (most recent call last): File "run_wav2vec_clf.py", line 490, in <module> main() File "run_wav2vec_clf.py", line 295, in main target_sampling_rate = feature_extractor.feature_extractor.sampling_rate AttributeError: 'Wav2Vec2FeatureExtractor' object has no attribute 'feature_extractor'

The solution for me was to replace with the line:

target_sampling_rate = feature_extractor.sampling_rate

Hope this helps if anyone else has the same problem.