nii-yamagishilab / PartialSpoof

BSD 3-Clause "New" or "Revised" License
41 stars 5 forks source link

problem in config in 03multireso #8

Closed DanMerry closed 4 months ago

DanMerry commented 4 months ago

Excuse me, I encountered some issues while reproducing the code. Could you please tell me where the config.py for the parameter module-config is located? image

zlin0 commented 4 months ago

@DanMerry Hi, thanks for your interest in Partial Spoof.

Did you follow README carefully? https://github.com/nii-yamagishilab/PartialSpoof/tree/main/03multireso#usuage

The base folder is created as the primary directory. you can use it as an example folder for experiments. In all base/00_run.sh scripts, I provided samples for training and inference. You can notice that I assign a value for --module-config config_ps.config_test_on_eval. I provided two configuration files in the config_ps folder. The --module-config option will be assigned a configuration file by default.

DanMerry commented 4 months ago

Thank you very much for your response. But I have one more question. When loading the pretrained model wav2vec, the task_cfg key was not read from the model. image

load wav2vec in the s3prl

image

the key in the download model from ssl_link="https://dl.fbaipublicfiles.com/fairseq/wav2vec/w2v_large_lv_fsh_swbd_cv.pt"

image The key of task_cfg is not in the downloaded model. Is the problem existing in the version of the download model or the version of s3prl?

Abdullah-Eisa commented 4 months ago

SA @DanMerry ,

I think you are using windows os while trying to run the project. So, you need to change env.sh file to add custom libraries properly.

If you have some ideas about how to setup the conda environment for the project with specific versions of Python libraries to run the PartialSpoof project properly , it will be great if you share them with me.

This new env.sh file suitable for windows might help you:

#!/bin/bash
# Load conda environment if necessary
# ROOT_PATH=`pwd`
ROOT_PATH=$(pwd -W) # Use `pwd -W` to get the correct Windows path
XW_PATH="${ROOT_PATH}/project-NN-Pytorch-scripts.202102"
MODULES_PATH="${ROOT_PATH}/modules"
S3PRL_PATH="${MODULES_PATH}/s3prl"

export PS_PATH="$ROOT_PATH"
echo "PS_PATH= $PS_PATH"
# export PYTHONPATH="${XW_PATH}:${ROOT_PATH}:${PYTHONPATH}:${MODULES_PATH}:${S3PRL_PATH}"
export PYTHONPATH="${XW_PATH};${ROOT_PATH};${PYTHONPATH};${MODULES_PATH};${S3PRL_PATH}"
echo "PYTHONPATH= $PYTHONPATH"
zlin0 commented 4 months ago

@DanMerry Hi, thank you for providing detailed information for your question. I reimplement this error using the lastest version of s3prl. This error can be solved if you download the model using links in s3prl/s3prl/upstream/*/hubconf.py. Those links starts with "https://huggingface.co/s3prl/converted_ckpts/..." provided checkpoint converted by s3prl, which includes the new introduced attribute "task_cfg"

You will get this error when you use the pretrained model downloaded from huggingface/fairseq.

DanMerry commented 4 months ago

Thanks very much. You previously provided a link to download the w2v2 model. Now it can be trained, but during inference, according to the readme.md file, there are the following problems: image

DanMerry commented 4 months ago

It seems like the 954 is the size of the score_ali and target_ali, 7642 is the batchsize*954. Different size cannot be concated, how to solve it. image