使用sidekit在UBM发言人适应期间出错

问题描述 投票:1回答:1

我已经训练了一个UBM模型,现在我正试图在我得到跟随错误时实现扬声器适应。

例外:show enroll / something.wav不在HDF5文件中

我在“feat”文件下面有两个文件“enroll”和“test”,它们分别包含用于训练和测试的功能(.h5),而我的enroll_idmap是用音频(.wav)生成的,仅用于训练。而且,我的wav文件和专家文件是分开的。我想我遇到了idmap的问题。 “enroll / something.wav”是我的enroll_idmap的右边,但那个“HDF5文件”是指什么?

谁能告诉我这个错误意味着什么以及如何解决它?

这是我的enroll_idmap的代码

def __init__(self):
    BASE_DIR = "./Database/sidekit_data"
    self.AUDIO_DIR = os.path.join(BASE_DIR, "audio")
    self.FEATURE_DIR = os.path.join(BASE_DIR, "feat")
    self.TASK_DIR = os.path.join(BASE_DIR, "task")    

def create_idMap(self, group):
    # Make enrollment (IdMap) file list
    group_dir = os.path.join(self.AUDIO_DIR, group) # enrollment data directory
    group_files = os.listdir(group_dir)
    group_models = [files.split('_')[0] for files in group_files] # list of model IDs
    group_segments = [group+"/"+f for f in group_files]

    # Generate IdMap
    group_idmap = sidekit.IdMap()
    group_idmap.leftids = np.asarray(group_models)
    group_idmap.rightids = np.asarray(group_segments)
    group_idmap.start = np.empty(group_idmap.rightids.shape, '|O')
    group_idmap.stop = np.empty(group_idmap.rightids.shape, '|O')
    if group_idmap.validate():
        group_idmap.write(os.path.join(self.TASK_DIR, group+'_idmap.h5'))
    else:
        raise RuntimeError('Problems with creating idMap file')

然后我得到enroll_idmap和test_idmap:

create_idMap("enroll")
create_idMap("test")

这是扬声器适配的代码,上面的错误在159_regat.accumulate_stat(...)的执行过程中出现:

BASE_DIR = "./Database/sidekit_data"

enroll_idmap = sidekit.IdMap.read(os.path.join(BASE_DIR, "task", "enroll_idmap.h5"))

ubm = sidekit.Mixture()    
model_name = "ubm_{}.h5".format(NUM_GUASSIANS)    
ubm.read(os.path.join(BASE_DIR, "ubm", model_name))

server_eval = sidekit.FeaturesServer(feature_filename_structure="./Database/sidekit_data/feat/{}.h5",
                                     ...
                                     ...)

print("Compute the sufficient statistics")

enroll_stat.accumulate_stat(ubm=ubm,
                        feature_server=server_eval,
                        seg_indices=range(enroll_stat.segset.shape[0]),
                        num_thread=nbThread
                        )

这似乎不是一个大问题,但它让我停了几天,请帮助。

python machine-learning speech-recognition voice-recognition sidekit
1个回答
1
投票

我终于通过改变训练和测试功能的路径来解决这个问题,使其在“BASEDIR”之外

server_eval = sidekit.FeaturesServer(feature_filename_structure="./enroll/{}.h5",
                                     ...)
© www.soinside.com 2019 - 2024. All rights reserved.