Labbeti / aac-metrics

Metrics for evaluating Automated Audio Captioning systems, designed for PyTorch.
https://aac-metrics.readthedocs.io/
MIT License
34 stars 3 forks source link

Error while downloading SBERT and BERT error detector for FENSE metric #8

Closed EricSanLopez closed 1 year ago

EricSanLopez commented 1 year ago

The module was installed with 'pip install aac-metrics'. The previous files were installed successfully.

Traceback (most recent call last): File "/home/esanchez/miniconda3/envs/xac-ic/bin/aac-metrics-download", line 8, in sys.exit(_main_download()) File "/home/esanchez/miniconda3/envs/xac-ic/lib/python3.10/site-packages/aac_metrics/download.py", line 308, in _main_download download( File "/home/esanchez/miniconda3/envs/xac-ic/lib/python3.10/site-packages/aac_metrics/download.py", line 125, in download _download_fense(verbose) File "/home/esanchez/miniconda3/envs/xac-ic/lib/python3.10/site-packages/aac_metrics/download.py", line 246, in _downloadfense = FENSE(device="cpu") File "/home/esanchez/miniconda3/envs/xac-ic/lib/python3.10/site-packages/aac_metrics/classes/fense.py", line 49, in init sbert_model, echecker, echecker_tokenizer = _load_models_and_tokenizer(sbert_model, echecker, None, device, reset_state, verbose) # type: ignore File "/home/esanchez/miniconda3/envs/xac-ic/lib/python3.10/site-packages/aac_metrics/functional/fense.py", line 130, in _load_models_and_tokenizer echecker, echecker_tokenizer = _load_echecker_and_tokenizer( File "/home/esanchez/miniconda3/envs/xac-ic/lib/python3.10/site-packages/aac_metrics/functional/fluerr.py", line 193, in _load_echecker_and_tokenizer echecker = __load_pretrain_echecker(echecker, device, verbose=verbose) File "/home/esanchez/miniconda3/envs/xac-ic/lib/python3.10/site-packages/aac_metrics/functional/fluerr.py", line 427, in __load_pretrain_echecker echecker.load_state_dict(model_states["state_dict"]) File "/home/esanchez/miniconda3/envs/xac-ic/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1671, in load_state_dict raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for BERTFlatClassifier: Unexpected key(s) in state_dict: "encoder.embeddings.position_ids".

EricSanLopez commented 1 year ago

It was due to the transformers version, my bad xd