MSR身份工具包(fopen)中的错误 [英] Error in MSR Identity toolkit (fopen)
问题描述
我尝试使用 MSR来运行演示程序以进行扬声器验证身份工具包.但是,在训练UBM步骤后却留下了错误.错误如下.看起来fopen
返回-1
并导致fread
错误.我不明白为什么它不能读取filenames
.我无法附加代码,因为它涉及许多功能.我只是希望熟悉此工具包的人能为我提供帮助.
I try to run a demo for speaker verification using MSR Identity toolkit. However it left error after training UBM step. The error is as follow. It looks like fopen
return -1
and cause error to fread
. I can't understand why it can't read the filenames
. I can't attach the code since it involves many functions. I just hope someone that familiar with this toolkit can help me.
Error using fread
Invalid file identifier. Use fopen to generate a valid file identifier.
Error in htkread (line 7)
nframes = fread(fid, 1, 'int32'); % number of frames
Error in mapAdapt>load_data (line 107)
data{ix} = htkread(filenames{ix});
Error in mapAdapt (line 52)
dataList = load_data(dataList);
Error in demo_gmm_ubm (line 69)
gmm_models{spk} = mapAdapt(spk_files, ubm, map_tau, config);
导致错误的部分代码,如下所示:
Part of the code where lead to the error as follow:
function data = load_data(datalist)
% load all data into memory
if ~iscellstr(datalist)
fid = fopen(datalist, 'rt');
filenames = textscan(fid, '%s');
fclose(fid);
filenames = filenames{1};
else
filenames = datalist;
end
nfiles = size(filenames, 1);
data = cell(nfiles, 1);
for ix = 1 : nfiles,
data{ix} = htkread(filenames{ix});
end
function [data, frate, feakind] = htkread(filename)
% read features with HTK format (uncompressed)
fid = fopen(filename, 'r','b'); %ERROR HERE
nframes = fread(fid, 1, 'int32'); % number of frames
frate = fread(fid, 1, 'int32'); % frame rate in nano-seconds unit
nbytes = fread(fid, 1, 'short'); % number of bytes per feature value
feakind = fread(fid, 1, 'short'); % 9 is USER
ndim = nbytes / 4; % feature dimension (4 bytes per value)
data = fread(fid, [ndim, nframes], 'float');
fclose(fid);
datalist
包含:
'features\fadg0_sa2.htk'
'features\fadg0_si1279.htk'
'features\fadg0_si1909.htk'
'features\fadg0_si649.htk'
'features\fadg0_sx109.htk'
'features\fadg0_sx19.htk'
'features\fadg0_sx199.htk'
'features\fadg0_sx289.htk'
'features\fadg0_sx379.htk'
推荐答案
您的fid返回负值吗?如果是,请尝试指定完整路径,其中dataList ='ubm.lst';在代码中
Is your fid returning a negative value? If yes, try specifying entire path where dataList= 'ubm.lst'; is in the code
这篇关于MSR身份工具包(fopen)中的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!