media-sec-lab / BAM

The pytorch implementation of BAM for Partialspoof Audio Localization.
10 stars 1 forks source link

error launching train.py #2

Open crankyz opened 2 months ago

crankyz commented 2 months ago

python train.py --test_only --checkpoint /home/igorv/BAM/bam_checkpoint/model.ckpt Seed set to 42 Traceback (most recent call last): File "train.py", line 238, in model = LightingModelWrapper.load_from_checkpoint(args.checkpoint, map_location='cpu', args=args) File "/home/igorv/anaconda3/envs/bam/lib/python3.8/site-packages/lightning/pytorch/core/module.py", line 1552, in load_from_checkpoint loaded = _load_from_checkpoint( File "/home/igorv/anaconda3/envs/bam/lib/python3.8/site-packages/lightning/pytorch/core/saving.py", line 89, in _load_from_checkpoint model = _load_state(cls, checkpoint, strict=strict, kwargs) File "/home/igorv/anaconda3/envs/bam/lib/python3.8/site-packages/lightning/pytorch/core/saving.py", line 156, in _load_state obj = cls(_cls_kwargs) File "train.py", line 28, in init self.model = model_cls(args,config) File "/home/igorv/BAM/models/bam.py", line 17, in init self.ssl_layer = getattr(hub, config.ssl_name)(ckpt=config.ssl_ckpt, fairseq=True) File "/home/igorv/anaconda3/envs/bam/lib/python3.8/site-packages/s3prl/upstream/wavlm/hubconf.py", line 25, in wavlm_local assert os.path.isfile(ckpt) AssertionError

looks like key checkpoint dosent work but if manually write in the "hubconf.py" path to model.ckpt got another error

python train.py --test_only --checkpoint '/home/igorv/BAM/bam_checkpoint/model.ckpt' Seed set to 42 Traceback (most recent call last): File "train.py", line 238, in model = LightingModelWrapper.load_from_checkpoint(args.checkpoint, map_location='cpu', args=args) File "/home/igorv/anaconda3/envs/bam/lib/python3.8/site-packages/lightning/pytorch/core/module.py", line 1552, in load_from_checkpoint loaded = _load_from_checkpoint( File "/home/igorv/anaconda3/envs/bam/lib/python3.8/site-packages/lightning/pytorch/core/saving.py", line 89, in _load_from_checkpoint model = _load_state(cls, checkpoint, strict=strict, kwargs) File "/home/igorv/anaconda3/envs/bam/lib/python3.8/site-packages/lightning/pytorch/core/saving.py", line 156, in _load_state obj = cls(_cls_kwargs) File "train.py", line 28, in init self.model = model_cls(args,config) File "/home/igorv/BAM/models/bam.py", line 17, in init self.ssl_layer = getattr(hub, config.ssl_name)(ckpt=config.ssl_ckpt, fairseq=True) File "/home/igorv/anaconda3/envs/bam/lib/python3.8/site-packages/s3prl/upstream/wavlm/hubconf.py", line 26, in wavlm_local return _UpstreamExpert(ckpt, *args, *kwargs) File "/home/igorv/anaconda3/envs/bam/lib/python3.8/site-packages/s3prl/upstream/interfaces.py", line 30, in call instance = super().call(args, **kwargs) File "/home/igorv/anaconda3/envs/bam/lib/python3.8/site-packages/s3prl/upstream/wavlm/expert.py", line 38, in init self.cfg = WavLMConfig(checkpoint["cfg"]) KeyError: 'cfg'

ZhongJiafeng-16 commented 2 months ago

It seems there was an issue loading the front-end pretrained model. Could you provide your s3prl version or other environment details? I'm trying to pinpoint the cause of the problem. Thanks.

crankyz commented 2 months ago

s3prl.version '0.4.15'

all conda packages:

Name Version Build Channel

_libgcc_mutex 0.1 main
_openmp_mutex 5.1 1_gnu
absl-py 2.1.0 pypi_0 pypi aiohappyeyeballs 2.3.5 pypi_0 pypi aiohttp 3.9.5 pypi_0 pypi aiosignal 1.3.1 pypi_0 pypi annotated-types 0.7.0 pypi_0 pypi antlr4-python3-runtime 4.9.3 pypi_0 pypi asteroid-filterbanks 0.4.0 pypi_0 pypi async-timeout 4.0.3 pypi_0 pypi attrs 23.2.0 pypi_0 pypi audioread 3.0.1 pypi_0 pypi ca-certificates 2024.7.2 h06a4308_0
cachetools 5.3.3 pypi_0 pypi certifi 2024.2.2 pypi_0 pypi cffi 1.16.0 pypi_0 pypi charset-normalizer 3.3.2 pypi_0 pypi ci-sdr 0.0.2 pypi_0 pypi click 8.1.7 pypi_0 pypi configargparse 1.7 pypi_0 pypi ctc-segmentation 1.7.4 pypi_0 pypi cython 3.0.11 pypi_0 pypi decorator 5.1.1 pypi_0 pypi distance 0.1.3 pypi_0 pypi editdistance 0.8.1 pypi_0 pypi einops 0.8.0 pypi_0 pypi espnet 202402 pypi_0 pypi espnet-tts-frontend 0.0.3 pypi_0 pypi fast-bss-eval 0.1.3 pypi_0 pypi filelock 3.14.0 pypi_0 pypi frozenlist 1.4.1 pypi_0 pypi fsspec 2024.5.0 pypi_0 pypi g2p-en 2.1.0 pypi_0 pypi google-auth 2.29.0 pypi_0 pypi google-auth-oauthlib 1.0.0 pypi_0 pypi grpcio 1.64.0 pypi_0 pypi h5py 3.11.0 pypi_0 pypi huggingface-hub 0.23.2 pypi_0 pypi humanfriendly 10.0 pypi_0 pypi hydra-core 1.3.2 pypi_0 pypi idna 3.7 pypi_0 pypi importlib-metadata 4.13.0 pypi_0 pypi importlib-resources 6.4.0 pypi_0 pypi inflect 7.0.0 pypi_0 pypi jaconv 0.4.0 pypi_0 pypi jamo 0.4.1 pypi_0 pypi jinja2 3.1.4 pypi_0 pypi joblib 1.4.2 pypi_0 pypi kaldiio 2.18.0 pypi_0 pypi lazy-loader 0.4 pypi_0 pypi ld_impl_linux-64 2.38 h1181459_1
libffi 3.4.4 h6a678d5_1
libgcc-ng 11.2.0 h1234567_1
libgomp 11.2.0 h1234567_1
librosa 0.9.2 pypi_0 pypi libstdcxx-ng 11.2.0 h1234567_1
lightning 2.1.0 pypi_0 pypi lightning-utilities 0.11.2 pypi_0 pypi llvmlite 0.41.1 pypi_0 pypi markdown 3.6 pypi_0 pypi markupsafe 2.1.5 pypi_0 pypi mpmath 1.3.0 pypi_0 pypi msgpack 1.0.8 pypi_0 pypi multidict 6.0.5 pypi_0 pypi ncurses 6.4 h6a678d5_0
networkx 3.1 pypi_0 pypi nltk 3.8.2 pypi_0 pypi numba 0.58.1 pypi_0 pypi numpy 1.23.5 pypi_0 pypi nvidia-cublas-cu12 12.1.3.1 pypi_0 pypi nvidia-cuda-cupti-cu12 12.1.105 pypi_0 pypi nvidia-cuda-nvrtc-cu12 12.1.105 pypi_0 pypi nvidia-cuda-runtime-cu12 12.1.105 pypi_0 pypi nvidia-cudnn-cu12 9.1.0.70 pypi_0 pypi nvidia-cufft-cu12 11.0.2.54 pypi_0 pypi nvidia-curand-cu12 10.3.2.106 pypi_0 pypi nvidia-cusolver-cu12 11.4.5.107 pypi_0 pypi nvidia-cusparse-cu12 12.1.0.106 pypi_0 pypi nvidia-nccl-cu12 2.20.5 pypi_0 pypi nvidia-nvjitlink-cu12 12.6.20 pypi_0 pypi nvidia-nvtx-cu12 12.1.105 pypi_0 pypi oauthlib 3.2.2 pypi_0 pypi omegaconf 2.3.0 pypi_0 pypi openssl 3.0.14 h5eee18b_0
opt-einsum 3.3.0 pypi_0 pypi packaging 24.0 pypi_0 pypi pillow 10.3.0 pypi_0 pypi pip 24.0 py38h06a4308_0
platformdirs 4.2.2 pypi_0 pypi pooch 1.8.1 pypi_0 pypi protobuf 3.20.3 pypi_0 pypi pyasn1 0.6.0 pypi_0 pypi pyasn1-modules 0.4.0 pypi_0 pypi pycparser 2.22 pypi_0 pypi pydantic 2.8.2 pypi_0 pypi pydantic-core 2.20.1 pypi_0 pypi pypinyin 0.44.0 pypi_0 pypi python 3.8.19 h955ad1f_0
pytorch-lightning 2.1.0 pypi_0 pypi pyworld 0.3.4 pypi_0 pypi pyyaml 6.0.1 pypi_0 pypi readline 8.2 h5eee18b_0
regex 2024.5.15 pypi_0 pypi requests 2.32.3 pypi_0 pypi requests-oauthlib 2.0.0 pypi_0 pypi resampy 0.4.3 pypi_0 pypi rsa 4.9 pypi_0 pypi s3prl 0.4.15 pypi_0 pypi safetensors 0.4.3 pypi_0 pypi scikit-learn 1.3.2 pypi_0 pypi scipy 1.10.1 pypi_0 pypi sentencepiece 0.1.97 pypi_0 pypi setuptools 72.1.0 py38h06a4308_0
six 1.16.0 pypi_0 pypi soundfile 0.12.1 pypi_0 pypi soxr 0.3.7 pypi_0 pypi sqlite 3.45.3 h5eee18b_0
sympy 1.13.2 pypi_0 pypi tensorboard 2.14.0 pypi_0 pypi tensorboard-data-server 0.7.2 pypi_0 pypi threadpoolctl 3.5.0 pypi_0 pypi tk 8.6.14 h39e8969_0
tokenizers 0.19.1 pypi_0 pypi torch 1.12.1+cu113 pypi_0 pypi torch-complex 0.4.4 pypi_0 pypi torchaudio 0.12.1+cu113 pypi_0 pypi torchmetrics 1.4.1 pypi_0 pypi torchvision 0.13.1+cu113 pypi_0 pypi tqdm 4.66.4 pypi_0 pypi transformers 4.41.2 pypi_0 pypi triton 3.0.0 pypi_0 pypi typeguard 2.13.3 pypi_0 pypi typing-extensions 4.10.0 pypi_0 pypi unidecode 1.3.8 pypi_0 pypi urllib3 2.2.1 pypi_0 pypi werkzeug 3.0.3 pypi_0 pypi wheel 0.43.0 py38h06a4308_0
xz 5.4.6 h5eee18b_1
yarl 1.9.4 pypi_0 pypi zipp 3.19.0 pypi_0 pypi zlib 1.2.13 h5eee18b_1