nesl / asvspoof2019

Our submission to the ASVspoof 2019: Automatic Speaker Verification Spoofing and Countermeasures Challenge
92 stars 40 forks source link

fuse_result.py can't decode the input files. #12

Open maymay1982 opened 4 years ago

maymay1982 commented 4 years ago

After run model_main.py, I got many .npy files and .pth files. But when I put these .npy files as input to run fuse_result.py, I got the following error: python fuse_result.py --input cache_train_LA_spect.npy cache_train_LA_mfcc.npy cache_train_LA_cqcc.npy --output=cache_train_LA.npy Processing input files : ['cache_train_LA_spect.npy', 'cache_train_LA_mfcc.npy', 'cachetrain LA_cqcc.npy'] Traceback (most recent call last): File "fuse_result.py", line 35, in fuse_result = fuse(args.input) File "fuse_result.py", line 21, in fuse frames = [read_frame(f) for f in file_list] File "fuse_result.py", line 21, in frames = [read_frame(f) for f in file_list] File "fuse_result.py", line 10, in read_frame data_np = np.genfromtxt(fname, dtype=str) File "/home/lishaomei/anaconda3/lib/python3.7/site-packages/numpy/lib/npyio.py", line 1761, i n genfromtxt first_line = _decode_line(next(fhd), encoding) File "/home/lishaomei/anaconda3/lib/python3.7/codecs.py", line 322, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0: invalid start byte

The same error happened when I put these .pth files as input to run fuse_result.py.

braveheartwithlove commented 4 years ago

@maymay1982 The input files should be RESULTS_FILE after evaluation, "python model_main.py --eval --eval_output=RESULTS_FILE --model_path=CHECKPOINT_FILE". It should work after your getting those files. "

maymay1982 commented 4 years ago

@braveheartwithlove Thanks for your reply. But when I ran python model_main.py --eval --eval_output=cqcc_result --model_path=./models/model_logical_cqcc_100_32_5e-05/epoch_99.pth, I got such error: File "model_main.py", line 192, in model.load_state_dict(torch.load(args.model_path)) File "/home/lishaomei/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 847, in load_state_dict self.class.name, "\n\t".join(error_msgs))) RuntimeError: Error(s) in loading state_dict for SpectrogramModel: size mismatch for fc1.weight: copying a param with shape torch.Size([128, 32]) from checkpoint, the shape in current model is torch.Size([128, 64]). Obviously, it's caused by I changed the model size in the training as you. Have you encountered this problem and solved it?

maymay1982 commented 4 years ago

@braveheartwithlove I changed the type of input file:python model_main.py --eval --eval_output=cqcc_result --model_path=cache_train_LA_cqcc.npy Then, got following error: Traceback (most recent call last): File "/mnt/publicStoreA/lishaomei/asvspoof2019-master/model_main.py", line 192, in model.load_state_dict(torch.load(args.model_path)) File "/home/lishaomei/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 820, in load_state_dict state_dict = state_dict.copy() AttributeError: 'tuple' object has no attribute 'copy' Can you help me?

maymay1982 commented 4 years ago

@braveheartwithlove I solved it by add "--features cqcc" when I called model_main.py --eval --eval_output=cqcc_result --model_path=cache_train_LA_cqcc.npy --features cqcc. Thanks a lot.

braveheartwithlove commented 4 years ago

@maymay1982 That is great!

braveheartwithlove commented 4 years ago

@maymay1982 by the way, could you please share here your final performance using cqcc features? My EER on dev data set is pretty good. 0.7%, but the EER on eval dataset is ~17%, which is too high in my setup. Thanks

wangziqi000 commented 4 years ago

@maymay1982 Thank you for helping us. @braveheartwithlove We also want to note three things: First, initialization plays a role in model performance, so use a different random seed might help. Secondly, the best EER is given by a fusion model, so using other varients of this network might help. Finally, you can also play with the number of CCs you extract and compare their performance.

maymay1982 commented 4 years ago

@braveheartwithlove I'm sorry that I had left the lab yesterday when I got your message. The EER of cqcc on dev dataset is 0.55, and I don't know how to test it on eval dataset. If convenient, would you please send a readme to my email: lishaomei_may@126.com? Thanks a lot.

ddave25 commented 4 years ago

@braveheartwithlove I solved it by add "--features cqcc" when I called model_main.py --eval --eval_output=cqcc_result --model_path=cache_train_LA_cqcc.npy --features cqcc. Thanks a lot.

Hi. The AttributeError still persists for me even after I added --features cqcc.

May I know which version of PyTorch you are using?

maymay1982 commented 4 years ago

@braveheartwithlove In my experiments using cqcc features, the EER on dev data set is 0.55%, and the EER on eval dataset is 12.1%, which is the worst among the three features.

braveheartwithlove commented 4 years ago

@maymay1982 It is similar to my simulation. In my test, Spect gives me the best performance so far.

maymay1982 commented 4 years ago

@ddave25 I'm sorry, the right command is: python model_main.py --eval --eval_output=cqcc_result --model_path=model_logical_cqcc_100_32_5e-05.pth --features cqcc。And the version of my PyTorch is 0.4.

ddave25 commented 4 years ago

@maymay1982 Thank you. That does work without errors.