GithubHelp home page GithubHelp logo

fakebob-adversarial-attack / fakebob Goto Github PK

View Code? Open in Web Editor NEW
95.0 5.0 30.0 12.43 MB

Source code for paper "Who is real Bob? Adversarial Attacks on Speaker Recognition Systems" (IEEE S&P 2021)

License: BSD 2-Clause "Simplified" License

Python 93.46% Shell 2.68% C++ 2.71% Dockerfile 1.16%
adversarial-attacks speaker-recognition-systems speaker-identification speaker-verification close-set-speaker-identification open-set-speaker-identification gmm-ubm ivector-plda ivector

fakebob's Introduction

FAKEBOB

Source code for paper "Who is real Bob? Adversarial Attacks on Speaker Recognition Systems".

Demonstration Website: FAKEBOB Website (including a One-Minute Video Preview)

Our paper has been accepted by 42nd IEEE Symposium on Security and Privacy (IEEE S&P, Oakland), 2021.

Paper link Who is real Bob? Adversarial Attacks on Speaker Recognition Systems.

Oakland 2021 Presentation Slide Session #5-GuangkeChen-WhoisRealBob

Oakland 2021 Talk Video: Presentation Video

Cite our paper as follow:

@INPROCEEDINGS {chen2019real,
    author = {G. Chen and S. Chen and L. Fan and X. Du and Z. Zhao and F. Song and Y. Liu},
    booktitle = {2021 IEEE Symposium on Security and Privacy (SP)},
    title = {Who is Real Bob? Adversarial Attacks on Speaker Recognition Systems},
    year = {2021},
    issn = {2375-1207},
    pages = {55-72},
    doi = {10.1109/SP40001.2021.00004},
}

New

  • [2022.11.18] FAKEBOB has been incorpoated into SpeakerGuard, a fully-pytorch-based platform for security analysis for speaker recognition. Consider using it if you want to get rid of the "messy" Kaidi.
  • [2021.05.12] We remove from the loss function the outermost maximum operation since it will cause unexpected issue for benign voices whose initial loss is slightly larger than adver_thresh.

For example, suppose adver_thresh=0, and the initial loss of a benign voice is 0.01. This voice is not robust enough, so add a random noise is enough to make it adversarial. Hence, the samples_per_draw noisy samples are adversarial voices. If the outermost maximum operation is retained, all the loss of these noisy samples are zero. So the estimated gradient remains zero, and the sample will not be updated throughout the iteration procedure.

That 's why we can only achieve 99% ASR, and not 100% in our paper. Using the updated loss function, we can achieve 100% ASR.

Basic

You can either use the docker environment (recommended) or follow the manual installation.

Docker installation

Setup

To set up the environment, run docker/setup.sh. This will build the docker environment and download all files.

Using the docker environment

After the setup is complete, you should be able to enter the docker environment by running docker/run.sh.

Testing the setup

Run docker/run.sh and then inside the docker environment python3 test.py. Alternatively you can run docker/run.sh python3 test.py to run the command in the docker environment. The test.py script will show you the baseline performance.

Generating adversarial voices

Run docker/run.sh and then ./attackMain.sh or run docker/run.sh ./attackMain.sh. You can find details in step nine of the manual installation.

Manual installation

Note that we have only tested our code on Ubuntu 16.04 system. It should work well as well on other Linux systems. Currently this project does NOT support and use GPU. It is our plan to release GPU version of this project. Stay tuned.

Reproduce our experiment step by step:

  1. Install Python 3.

    • Required packages: numpy, scipy.
    • We recommend using Anaconda and Python Virtual Enviroment.
  2. Download and install Kaldi Toolkit.

    • Download kaldi from Kaldi website.
      Let $KALDI_ROOT be the root path of your download. Root path means the parent directory of src/, egs/, etc.
    • Add the C file gmm-global-est-map.cc in our reposity to $KALDI_ROOT/src/gmmbin/.
      This file will be compiled to an executable file which is needed by GMM-UBM system.
    • Edit the file $KALDI_ROOT/src/gmmbin/Makefile by adding gmm-global-est-map to BINFILES list. If not, gmm-global-est-map.cc will not be compiled to executable file.
    • Build the toolkit according to the instruction in $KALDI_ROOT/INSTALL.
  3. After successfully building Kaldi toolkit, run the egs/voxceleb/v1 recipe.

    • download the VoxCeleb1 and VoxCeleb2 dataset from VoxCeleb1 Dataset, VoxCeleb2 Dataset.
    • change directory to egs/voxceleb/v1.
    • modify the variables voxceleb1_root and voxceleb2_root in line 19 and line 20 of run.sh to your actual location of datasets.
    • run the shell scipt ./run.sh. You may need to resolve permission denied problem by shell command chmod 777 ./run.sh
  4. After egs/voxceleb/v1 recipe completes running, copy (or make soft link for) the following files or directories to the pre-models directory of this reposity.

    • change directory to your location of FAKEBOB and create a new directory named pre-models.
    • copy (or make soft link) final.dubm, final.ubm, final.ie, delta_opts in $KALDI_ROOT/egs/voxceleb/v1/exp/extractor/ to pre-models/.
    • copy (or make soft link) plda, mean.vec, transform.mat in voxceleb/v1/exp/ivectors_train/ to pre-models/.
    • copy (or make soft link) conf/ in voxceleb/v1 to pre-models/.
    • copy (or make soft link) sid/, steps/, utils/ in voxceleb/v1 to pre-models/.
  5. Downoad our dataset. Our used dataset comes from LibriSpeech. We just select part of it and convert the .flac format to .wav format.

    • download data.tgz from data.tar.gz, 921MB. Make sure you have downloaded it correctly by checking its MD5: 43934261ea3e200064f00573ada01d6d
    • untar data.tgz to the location of FAKEBOB, after which you will see a new directory named data/.
      Inside data/, there are four sub directories, i.e., enrollment-set, z-norm-set, test-set and illegal-set.
  6. Setting the System Variable which kaldi relies on. We have made it as simple as possible. You just need to copy and paste all the commands in path_cmd.sh to your ~/.bashrc. Do not forget to modify KALDI_ROOT and FAKEBOB_PATH in path_cmd.sh.

    • vim ~/.bashrc
    • modify KALDI_ROOT and FAKEBOB_PATH in path_cmd.sh
    • copy and paste all the commands to ~/.bashrc
    • source ~/.bashrc
  7. Build speaker unique models for enrolled speakers in enrollment-set.

    • Running the python file build_spk_models.py.
    • After running completed, you will see several new directories, among which models/ stores the speaker unique models of ivector-PLDA system (in the form of ID.iv) and GMM-UBM system (in the form of ID.gmm).
    • If you work on a server with multiple cores, you'd better set n_jobs (Line 35) to a larger number to speed up the computation. But be cautious about the value since the program will crash with a too large value for n_job.
  8. Testing the baseline performance of ivector-PLDA-based and GMM-UBM-based OSI, CSI, SV systems.

    • Running the python file test.py.
    • During running, the baseline performance will be displayed in your terminal. As you can see, all of these systems are well-performed without attack.
    • Again, if you work on a server with multiple cores, you'd better set n_jobs (Line 19) to a larger number to speed up the computation.
  9. Generate adversarial voices for speaker recognition systems (launch our attack FAKEBOB).

    • modify the variable KALDI_ROOT in attackMain.sh to your root path of kaldi.
    • adjust the parameters in attackMain.sh.
      For example, if you would like to launch targeted attack against ivector-PLDA-based CSI, just set archi=iv, task=CSI,attack_type=targeted.
      You can also adjust other parameters which is associated with the efficiency and effectiveness of our attack FAKEBOB such as epsilon.
    • The generated adversarial voices are stored in adversarial-audio, and the corresponding checkpoints about the iterative procedures are in checkpoint.
    • The execuation time for each iteration depends on your machines.
      On our machine, about 12s for ivector-PLDA and 5s for GMM-UBM.
      You can adjust n_jobs and samples_per_draw to decrease this time.
      But note that smaller samples_per_draw may lead to slower covergence and too large n_jobs may increase the time in contrast.
    • For SV/OSI task, by default the attack will first estimate the threshold which is used for crafting adversarial examples. If you wish to skip the threshold estimation, you can use the hard-code threshold (see Line 356-360 and Line 393-397 in attackMain.py).

Since step 3 consumes quite a long time, you can choose to download pre-models.tgz from pre-models.tgz, 493MB. The MD5 should be a61fd0f2a470eb6f9bdba11f5b71a123. After downloading, just untar it to the location of FAKEBOB. Then you can skip both step 3 and step 4.

Extension

If you would like to use your own dataset or attack other speaker recognition systems (e.g., DNN-based systems), here are some tips.

Use your own dataset

Each audio file should be in .wav format and named in the form of ID-XXX.wav (e.g., 1580-141084-0048.wav) where ID denotes the unique speaker id of the speaker.
You can exploit ffmpeg tool to change the format of your own audios.
If your audios are not sampled at 16 KHZ or not quantized with 16 bits, you need to modify the fs and bits_per_sample in some .py file or specific them when calling some functions.

Here are the specification of the four sub directories in data/. It should help you prepare your own dataset more easily.

  1. enrollment-set: voice datas used for enrollment. One audio corresponds to one enrolled speaker.
  2. z-norm-set: voice data from imposters to obtain z_norm mean and z_norm std for scoring normalization.
  3. test-set: each sub-folder contains voice datas of one enrolled speaker in enrollment-set.
    The name of each sub-folder should be the unique speaker ID of the corresponding speaker.
  4. illegal-set: each sub-folder contains voice datas of one imposter (imposters are not in enrollment-set).
    The name of each sub-folder should be the unique speaker ID of the corresponding speaker.

Attack other speaker recognition systems

To generate adversarial voices on other speaker recognition systems using our attack FAKEBOB, what you need to do is quite simple: just wrap your system by providing two interface - function score and make_decisions. Please refer to gmm_ubm_OSI.py, gmm_ubm_CSI.py, gmm_ubm_SV.py, ivector_PLDA_OSI.py, ivector_PLDA_CSI.py, ivector_PLDA_SV.py for details about the input and output arguments.

If you have any question, feel free to comment or contact.

fakebob's People

Contributors

cumt-gpf avatar fakebob-adversarial-attack avatar golferchen avatar tom-doerr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

fakebob's Issues

Something wrong in 'build_spk_models.py' or 'pre-models'

In step 6, when I run build_spk_models.py and I usd the pre-models you provide, there are something wrong:

----- step 1: generate ivector identity and corresponding speaker model, setting threshold -----
--- extracting and scoring ---
/root/kaldi-trunnk/FAKEBOB/pre-models/utils/fix_data_dir.sh: file /root/kaldi-trunnk/FAKEBOB/audio-build-model-iv/utt2spk is not in sorted order or not unique, sorting it
/root/kaldi-trunnk/FAKEBOB/pre-models/utils/fix_data_dir.sh: file /root/kaldi-trunnk/FAKEBOB/audio-build-model-iv/wav.scp is not in sorted order or not unique, sorting it
fix_data_dir.sh: kept all 5316 utterances.
fix_data_dir.sh: old files are kept in /root/kaldi-trunnk/FAKEBOB/audio-build-model-iv/.backup
/root/kaldi-trunnk/FAKEBOB/pre-models/steps/make_mfcc.sh --write-utt2num-frames true --mfcc-config /root/kaldi-trunnk/FAKEBOB/pre-models/conf/mfcc.conf --nj 28 --cmd $train_cmd /root/kaldi-trunnk/FAKEBOB/audio-build-model-iv /root/kaldi-trunnk/FAKEBOB/log-build-model-iv /root/kaldi-trunnk/FAKEBOB/mfcc-build-model-iv
/root/kaldi-trunnk/FAKEBOB/pre-models/steps/make_mfcc.sh: line 20: parse_options.sh: No such file or directory
/root/kaldi-trunnk/FAKEBOB/pre-models/sid/compute_vad_decision.sh --nj 28 --cmd $train_cmd --vad-config /root/kaldi-trunnk/FAKEBOB/pre-models/conf/vad.conf /root/kaldi-trunnk/FAKEBOB/audio-build-model-iv /root/kaldi-trunnk/FAKEBOB/log-build-model-iv /root/kaldi-trunnk/FAKEBOB/mfcc-build-model-iv
/root/kaldi-trunnk/FAKEBOB/pre-models/sid/compute_vad_decision.sh: line 18: parse_options.sh: No such file or directory
/root/kaldi-trunnk/FAKEBOB/pre-models/sid/extract_ivectors.sh --cmd $train_cmd --nj 28 --num-threads 1 /root/kaldi-trunnk/FAKEBOB/pre-models /root/kaldi-trunnk/FAKEBOB/audio-build-model-iv /root/kaldi-trunnk/FAKEBOB/ivector-build-model-iv
/root/kaldi-trunnk/FAKEBOB/pre-models/sid/extract_ivectors.sh: line 27: parse_options.sh: No such file or directory
Traceback (most recent call last):
File "build_spk_models.py", line 185, in
n_jobs=n_jobs, flag=1, debug=debug)
File "/root/kaldi-trunnk/FAKEBOB/ivector_PLDA_kaldiHelper.py", line 327, in score_existing
plda=plda, mean_vec=mean_vec, transform_mat=transform_mat, debug=debug)
File "/root/kaldi-trunnk/FAKEBOB/ivector_PLDA_kaldiHelper.py", line 272, in plda_scoring
p = subprocess.Popen(args) if debug else subprocess.Popen(args, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
File "/usr/lib/python3.5/subprocess.py", line 947, in init
restore_signals, start_new_session)
File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child
raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'ivector-plda-scoring'

#it seems that something lost in pre-models

No such file or directory: 'ivector-plda-scoring'

hello, I'm impressed with your work.
when I run build_spk_models.py, I face the error: No such file or directory: 'ivector-plda-scoring'
But 'ivector-plda-scoring' exists in KALDI_ROOT/src/ivectorbin.

root@c9c5cf113b47:/mounted# python3 build_spk_models.py
----- step 1: generate ivector identity and corresponding speaker model -----
--- extracting and scoring ---
Traceback (most recent call last):
File "build_spk_models.py", line 114, in
n_jobs=n_jobs, flag=1, debug=debug)
File "/mounted/ivector_PLDA_kaldiHelper.py", line 332, in score_existing
plda=plda, mean_vec=mean_vec, transform_mat=transform_mat, debug=debug)
File "/mounted/ivector_PLDA_kaldiHelper.py", line 277, in plda_scoring
p = subprocess.Popen(args) if debug else subprocess.Popen(args, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
File "/usr/lib/python3.5/subprocess.py", line 947, in init
restore_signals, start_new_session)
File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child
raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'ivector-plda-scoring'

problem in step 8 running 'test.py' about 'data'

A data called '1580-141084-0049.wav' in '1580' is a shortcut with 0 bytes.

Traceback (most recent call last):
File "./test.py", line 90, in
_, audio = read(path)
File "/home/neu/anaconda3/lib/python3.8/site-packages/scipy/io/wavfile.py", line 544, in read
fid = open(filename, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: './data/test-set/1580/1580-141084-0049.wav'
QQ截图20201013085336

Extracting and scoring issue at step 7

Hi there,

Thanks for sharing the code. I wonder if you can help on the issue described below.

I am following the instruction step and step to try the code. I used the pre-models you provided, and got an issue at step 7.

----- step 1: generate ivector identity and corresponding speaker model -----

--- extracting and scoring ---

/Users/user1/FAKEBOB/ivector_PLDA_kaldiHelper.py:285: UserWarning: loadtxt: Empty input file: "/Users/user1/FAKEBOB/ivector-build-model-iv/scores"

scores_mat = np.loadtxt(scores_file, dtype=str)

Traceback (most recent call last):

File "build_spk_models.py", line 112, in

iv_helper.score_existing(audio_path_list, enroll_utt_id, spk_id_list=spk_id_list,

File "/Users/user1/FAKEBOB/ivector_PLDA_kaldiHelper.py", line 334, in score_existing

score_array = self.resolve_score()

File "/Users/user1/FAKEBOB/ivector_PLDA_kaldiHelper.py", line 290, in resolve_score

train_utt_id = scores_mat[:, 0]

IndexError: index 0 is out of bounds for axis 1 with size 0

I checked that FAKEBOB/ivector-build-model-iv/scores seems to be an empty file. Could you please help give some guidance on this?

Thanks

ERRO[0001] error waiting for container: context canceled

Hi there,
I followed the docker instruction to run 'docker/setup.sh', but have the following problem:

export PATH=$FAKEBOB_PATH/pre-models/utils/:$KALDI_ROOT/tools/openfst/bin:$KALDI_ROOT/tools/sph2pipe_v2.5:$PATH;
[ ! -f $KALDI_ROOT/tools/config/common_path.sh ] && echo >&2 "The standard file $KALDI_ROOT/tools/config/common_path.sh is not present -> Exit!" && exit 1;
. $KALDI_ROOT/tools/config/common_path.sh;
export LC_ALL=C;
export train_cmd="run.pl --mem 4G";
cd /mounted;
python3 build_spk_models.py'
docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]].
ERRO[0001] error waiting for container: context canceled

Could you help me to solve this problem?
Thanks,

Add enrollment error

When I add other voice to data/enrollment-set and run build_spk_models.py I got the following error message:
how can i add other voice to enrollment

----- step 1: generate ivector identity and corresponding speaker model -----
--- extracting and scoring ---
--- extracting and scoring done---
--- resolve score and obtain z norm mean and std value ---
/usr/local/lib/python3.5/dist-packages/numpy/core/fromnumeric.py:2920: RuntimeWarning: Mean of empty slice.
out=out, **kwargs)
/usr/local/lib/python3.5/dist-packages/numpy/core/_methods.py:85: RuntimeWarning: invalid value encountered in double_scalars
ret = ret.dtype.type(ret / rcount)
/usr/local/lib/python3.5/dist-packages/numpy/core/_methods.py:140: RuntimeWarning: Degrees of freedom <= 0 for slice
keepdims=keepdims)
/usr/local/lib/python3.5/dist-packages/numpy/core/_methods.py:110: RuntimeWarning: invalid value encountered in true_divide
arrmean, rcount, out=arrmean, casting='unsafe', subok=False)
/usr/local/lib/python3.5/dist-packages/numpy/core/_methods.py:132: RuntimeWarning: invalid value encountered in double_scalars
ret = ret.dtype.type(ret / rcount)
--- resolve score, and obtain z norm mean and std value done ---
--- dump speaker unique model ---
Traceback (most recent call last):
File "build_spk_models.py", line 150, in
ivectors_location[np.argwhere(ivectors_utt == utt_id).flatten()[0]]) # use absolute path
IndexError: index 0 is out of bounds for axis 0 with size 0

test.py: No such file or directory: 'model/1580.iv'

hello, when I enter the docker, run test.py. I face the error: No such file or directory: 'model/1580.iv'

root@c9c5cf113b47:/mounted# python3 test.py
Traceback (most recent call last):
File "test.py", line 32, in
with open(path, "rb") as reader:
FileNotFoundError: [Errno 2] No such file or directory: 'model/1580.iv'

I find the dir "model" is empty

Failed building Docker: Unable to establish SSL connection

Hello,
I am unable to build Docker.

config.status: creating src/extensions/python/Makefile
Unable to establish SSL connection.
Unable to establish SSL connection.
Makefile:185: recipe for target 'cub-1.8.0.tar.gz' failed
make: *** [cub-1.8.0.tar.gz] Error 4
make: *** Waiting for unfinished jobs....
Makefile:166: recipe for target 'sph2pipe-2.5.tar.gz' failed
make: *** [sph2pipe-2.5.tar.gz] Error 4
config.status: creating src/extensions/special/Makefile
config.status: creating src/script/Makefile
config.status: creating config.h
Read error (Connection timed out) in headers.
config.status: creating src/include/fst/config.h
config.status: src/include/fst/config.h is unchanged
config.status: executing depfiles commands

Any suggestions?

Thanks!

Is gpu used in Generate adversarial voices

Hi, thank you for you nice work. I have successfully run the project, however I noticed that my gpu resources remained unused and the attacking step (running attackMain.sh) has taken me more than 18 hours and not finished yet. I wonder if this is because I missed any configurations or this project does not use gpu?
btw how long should an attack process take generally?

New change on loss function

Hi,

The fakeBob process is stopped by the loss to 0.
However, when I applied the change and found that fakeBob goes to max iterations for every file even if the score is higher than the threshold.
Here is the code clip of stopping check:
image
Here is the new code change of loss fucntion of SV part:
image

Thanks

Issue at step 8 test.py

Hi there,

Unfortunately, I got another error here. The error message a bit long but I feel it's because I cannot open FAKEBOB/test-iv-CSI/ivector/ivector.scp as highlighted below. Any suggestions?

The file is not empty, and with a size of 416 bytes.


./data/test-set/2830/2830-3980-0065.wav

./data/test-set/2830/2830-3980-0071.wav

./data/test-set/2830/2830-3980-0059.wav

./data/test-set/2830/2830-3980-0058.wav

./data/test-set/2830/2830-3980-0070.wav

./data/test-set/2830/2830-3980-0064.wav

fix_data_dir.sh: kept all 495 utterances.

fix_data_dir.sh: old files are kept in /Users/user1/FAKEBOB/test-iv-CSI/audio/.backup

/Users/user1/FAKEBOB/pre-models/steps/make_mfcc.sh --write-utt2num-frames true --mfcc-config /Users/user1/FAKEBOB/pre-models/conf/mfcc.conf --nj 1 --cmd $train_cmd /Users/user1/FAKEBOB/test-iv-CSI/audio /Users/user1/FAKEBOB/test-iv-CSI/log /Users/user1/FAKEBOB/test-iv-CSI/mfcc

/Users/user1/FAKEBOB/pre-models/steps/make_mfcc.sh: empty argument to --cmd option

/Users/user1/FAKEBOB/pre-models/steps/compute_vad_decision.sh --nj 1 --cmd $train_cmd --vad-config /Users/user1/FAKEBOB/pre-models/conf/vad.conf /Users/user1/FAKEBOB/test-iv-CSI/audio /Users/user1/FAKEBOB/test-iv-CSI/log /Users/user1/FAKEBOB/test-iv-CSI/mfcc

/Users/user1/FAKEBOB/pre-models/steps/compute_vad_decision.sh: empty argument to --cmd option

/Users/user1/FAKEBOB/pre-models/sid/extract_ivectors.sh --cmd $train_cmd --nj 1 --num-threads 1 /Users/user1/FAKEBOB/pre-models /Users/user1/FAKEBOB/test-iv-CSI/audio /Users/user1/FAKEBOB/test-iv-CSI/ivector

/Users/user1/FAKEBOB/pre-models/sid/extract_ivectors.sh: empty argument to --cmd option

ivector-plda-scoring --normalize-length=true 'ivector-copy-plda --smoothing=0.0 /Users/user1/FAKEBOB/pre-models/plda - |' 'ark:ivector-subtract-global-mean /Users/user1/FAKEBOB/pre-models/mean.vec scp:/Users/user1/FAKEBOB/test-iv-CSI/ivector.scp ark:- | transform-vec /Users/user1/FAKEBOB/pre-models/transform.mat ark:- ark:- | ivector-normalize-length ark:- ark:- |' 'ark:ivector-subtract-global-mean /Users/user1/FAKEBOB/pre-models/mean.vec scp:/Users/user1/FAKEBOB/test-iv-CSI/ivector/ivector.scp ark:- | transform-vec /Users/user1/FAKEBOB/pre-models/transform.mat ark:- ark:- | ivector-normalize-length ark:- ark:- |' "cat /Users/user1/FAKEBOB/test-iv-CSI/ivector/trials | cut -d' ' -f 1,2 |" /Users/user1/FAKEBOB/test-iv-CSI/ivector/scores

ivector-copy-plda --smoothing=0.0 /Users/user1/FAKEBOB/pre-models/plda -

ivector-subtract-global-mean /Users/user1/FAKEBOB/pre-models/mean.vec scp:/Users/user1/FAKEBOB/test-iv-CSI/ivector.scp ark:-

ivector-normalize-length ark:- ark:-

LOG (ivector-subtract-global-mean[5.5.713~3-31c2]:main():ivector-subtract-global-mean.cc:108) Wrote 5 mean-subtracted iVectors

transform-vec /Users/user1/FAKEBOB/pre-models/transform.mat ark:- ark:-

LOG (transform-vec[5.5.713~3-31c2]:main():transform-vec.cc:85) Applied transform to 5 vectors.

LOG (ivector-normalize-length[5.5.713~3-31c2]:main():ivector-normalize-length.cc:90) Processed 5 iVectors.

LOG (ivector-normalize-length[5.5.713~3-31c2]:main():ivector-normalize-length.cc:94) Average ratio of iVector to expected length was 1.33827, standard deviation was 0.0804826

ivector-subtract-global-mean /Users/user1/FAKEBOB/pre-models/mean.vec scp:/Users/user1/FAKEBOB/test-iv-CSI/ivector/ivector.scp ark:-

ivector-normalize-length ark:- ark:-

WARNING (ivector-subtract-global-mean[5.5.713~3-31c2]:Open():util/kaldi-table-inl.h:106) Failed to open script file /Users/user1/FAKEBOB/test-iv-CSI/ivector/ivector.scp

ERROR (ivector-subtract-global-mean[5.5.713~3-31c2]:SequentialTableReader():util/kaldi-table-inl.h:860) Error constructing TableReader: rspecifier is scp:/Users/user1/FAKEBOB/test-iv-CSI/ivector/ivector.scp

[ Stack-Trace: ]

0 libkaldi-base.dylib 0x000000010878692f kaldi::KaldiGetStackTrace() + 63

1 libkaldi-base.dylib 0x00000001087866a2 kaldi::MessageLogger::LogMessage() const + 354

2 ivector-subtract-global-mean 0x0000000107bdd178 kaldi::MessageLogger::LogAndThrow::operator=(kaldi::MessageLogger const&) + 24

3 ivector-subtract-global-mean 0x0000000107bdcf07 kaldi::SequentialTableReader<kaldi::KaldiObjectHolder<kaldi::Vector > >::SequentialTableReader(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&) + 151

4 ivector-subtract-global-mean 0x0000000107bd9adc main + 684

5 libdyld.dylib 0x00007fff689df7fd start + 1

kaldi::KaldiFatalErrortransform-vec /Users/user1/FAKEBOB/pre-models/transform.mat ark:- ark:-

LOG (transform-vec[5.5.713~3-31c2]:main():transform-vec.cc:85) Applied transform to 0 vectors.

LOG (ivector-normalize-length[5.5.713~3-31c2]:main():ivector-normalize-length.cc:90) Processed 0 iVectors.

LOG (ivector-plda-scoring[5.5.713~3-31c2]:main():ivector-plda-scoring.cc:96) Reading train iVectors

LOG (ivector-plda-scoring[5.5.713~3-31c2]:main():ivector-plda-scoring.cc:122) Read 5 training iVectors, errors on 0

LOG (ivector-plda-scoring[5.5.713~3-31c2]:main():ivector-plda-scoring.cc:126) Average renormalization scale on training iVectors was 0.987333

LOG (ivector-plda-scoring[5.5.713~3-31c2]:main():ivector-plda-scoring.cc:129) Reading test iVectors

LOG (ivector-plda-scoring[5.5.713~3-31c2]:main():ivector-plda-scoring.cc:147) Read 0 test iVectors.

ERROR (ivector-plda-scoring[5.5.713~3-31c2]:main():ivector-plda-scoring.cc:149) No test iVectors present.

[ Stack-Trace: ]

0 libkaldi-base.dylib 0x000000010ac6e92f kaldi::KaldiGetStackTrace() + 63

1 libkaldi-base.dylib 0x000000010ac6e6a2 kaldi::MessageLogger::LogMessage() const + 354

2 ivector-plda-scoring 0x000000010a08d3a8 kaldi::MessageLogger::LogAndThrow::operator=(kaldi::MessageLogger const&) + 24

3 ivector-plda-scoring 0x000000010a08cd2c main + 4012

4 libdyld.dylib 0x00007fff689df7fd start + 1

WARNING (ivector-plda-scoring[5.5.713~3-31c2]:Close():kaldi-io.cc:515) Pipe ivector-subtract-global-mean /Users/user1/FAKEBOB/pre-models/mean.vec scp:/Users/user1/FAKEBOB/test-iv-CSI/ivector/ivector.scp ark:- | transform-vec /Users/user1/FAKEBOB/pre-models/transform.mat ark:- ark:- | ivector-normalize-length ark:- ark:- | had nonzero return status 256

ERROR (ivector-plda-scoring[5.5.713~3-31c2]:~SequentialTableReaderArchiveImpl():util/kaldi-table-inl.h:678) TableReader: error detected closing archive 'ivector-subtract-global-mean /Users/user1/FAKEBOB/pre-models/mean.vec scp:/Users/user1/FAKEBOB/test-iv-CSI/ivector/ivector.scp ark:- | transform-vec /Users/user1/FAKEBOB/pre-models/transform.mat ark:- ark:- | ivector-normalize-length ark:- ark:- |'

[ Stack-Trace: ]

0 libkaldi-base.dylib 0x000000010ac6e92f kaldi::KaldiGetStackTrace() + 63

1 libkaldi-base.dylib 0x000000010ac6e6a2 kaldi::MessageLogger::LogMessage() const + 354

2 ivector-plda-scoring 0x000000010a08d3a8 kaldi::MessageLogger::LogAndThrow::operator=(kaldi::MessageLogger const&) + 24

3 ivector-plda-scoring 0x000000010a092375 kaldi::SequentialTableReaderArchiveImpl<kaldi::KaldiObjectHolder<kaldi::Vector > >::~SequentialTableReaderArchiveImpl() + 213

4 ivector-plda-scoring 0x000000010a091c0e kaldi::SequentialTableReaderArchiveImpl<kaldi::KaldiObjectHolder<kaldi::Vector > >::~SequentialTableReaderArchiveImpl() + 14

5 ivector-plda-scoring 0x000000010a08d03d main + 4797

6 libdyld.dylib 0x00007fff689df7fd start + 1

libc++abi.dylib: terminating with uncaught exception of type kaldi::KaldiFatalError: kaldi::KaldiFatalError

Traceback (most recent call last):

File "test.py", line 97, in

decisions, _ = iv_csi_model.make_decisions(audio_list, debug=debug, n_jobs=n_jobs)

File "/Users/user1/FAKEBOB/ivector_PLDA_CSI.py", line 124, in make_decisions

score_array = self.score(audios, fs=fs, bits_per_sample=bits_per_sample, n_jobs=n_jobs, debug=debug)

File "/Users/user1/FAKEBOB/ivector_PLDA_CSI.py", line 116, in score

score_array = self.kaldi_helper.score(audio_list, self.utt_ids, n_jobs=n_jobs, flag=1, train_ivector_scp=self.train_ivector_scp, debug=debug)

File "/Users/user1/FAKEBOB/ivector_PLDA_kaldiHelper.py", line 363, in score

score_array = self.resolve_score()

File "/Users/user1/FAKEBOB/ivector_PLDA_kaldiHelper.py", line 286, in resolve_score

scores_mat = np.loadtxt(scores_file, dtype=str)

File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/numpy/lib/npyio.py", line 981, in loadtxt

fh = np.lib._datasource.open(fname, 'rt', encoding=encoding)

File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/numpy/lib/_datasource.py", line 269, in open

return ds.open(path, mode, encoding=encoding, newline=newline)

File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/numpy/lib/_datasource.py", line 623, in open

raise IOError("%s not found." % path)

OSError: /Users/user1/FAKEBOB/test-iv-CSI/ivector/scores not found. `

test.py: No such file or directory: 'ivector-plda-scoring'

Excuse me.
I met the problem in run test.py and not sure it from kaldi or code:

Traceback (most recent call last):
File "test.py", line 94, in
decisions, _ = iv_csi_model.make_decisions(audio_list, debug=debug, n_jobs=n_jobs)

File "/mnt/hgfs/share_for_ubuntu/FAKEBOB/ivector_PLDA_CSI.py", line 124, in make_decisions
score_array = self.score(audios, fs=fs, bits_per_sample=bits_per_sample, n_jobs=n_jobs, debug=debug)

File "/mnt/hgfs/share_for_ubuntu/FAKEBOB/ivector_PLDA_CSI.py", line 116, in score
score_array = self.kaldi_helper.score(audio_list, self.utt_ids, n_jobs=n_jobs, flag=1, train_ivector_scp=self.train_ivector_scp, debug=debug)

File "/mnt/hgfs/share_for_ubuntu/FAKEBOB/ivector_PLDA_kaldiHelper.py", line 359, in score
self.plda_scoring(train_ivector_scp=train_ivector_scp, test_ivector_scp=test_ivector_scp, trials_file=trials_file, scores_file=scores_file,

File "/mnt/hgfs/share_for_ubuntu/FAKEBOB/ivector_PLDA_kaldiHelper.py", line 277, in plda_scoring
p = subprocess.Popen(args) if debug else subprocess.Popen(args, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)

File "/home/neu/anaconda3/lib/python3.8/subprocess.py", line 854, in init
self._execute_child(args, executable, preexec_fn, close_fds,

File "/home/neu/anaconda3/lib/python3.8/subprocess.py", line 1702, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)

FileNotFoundError: [Errno 2] No such file or directory: 'ivector-plda-scoring'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.