Walleclipse / Deep_Speaker-speaker_recognition_system

Keras implementation of ‘’Deep Speaker: an End-to-End Neural Speaker Embedding System‘’ (speaker recognition)
245 stars 81 forks source link

预训练有问题 #56

Closed AnnaXiong closed 3 years ago

AnnaXiong commented 4 years ago

D:\SOFTWARE\Anaconda3\lib\site-packages\h5py__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type. from ._conv import register_converters as _register_converters Using TensorFlow backend. Found 0000368 files with 00003 different speakers.

程序运行到这就不动了,我是win7 64位的系统,用的Python3.6,请问你知道这是什么原因吗

Walleclipse commented 4 years ago

你好,目前看起来这只是警告,没有错误,应该可以继续运行。 有可能运行太慢了,你运行的是 pretraining.py 么? 你可以再等等,或者debug 运行每一行试试。

AnnaXiong commented 4 years ago

是运行的pretrainning.py,都几个小时了,还是一动不动的。我之前有调试过,然后再往下走到 103 x_test, y_test = testloader.next() 这句,它就成我之前说的那样了

AnnaXiong commented 4 years ago

我步入 103 x_test, y_test = testloader.next() ,进入def batchTestImageLoader(test_data, labels_to_id, no_of_speakers, batch_size=c.BATCH_SIZE * c.TRIPLET_PER_BATCH): paths = test_data L = len(paths) while True: np.random.shuffle(paths) batch_start = 0 batch_end = batch_size

    while batch_end < L:
        x_test_t, y_test_t = loadFromList(paths, batch_start, batch_end, labels_to_id, no_of_speakers)
        yield (x_test_t, y_test_t)
        batch_start += batch_size
        batch_end += batch_size

,然后就是进入了while True死循环了,因为不管怎样,batch_end = L

Walleclipse commented 4 years ago

这里哪怕是死循环也没有问题。因为这里有 yield函数,每次调用 next的时候它才会运行。你可以看一下 相关介绍.
这段代码 batchTestImageLoader的作用就是,构造 batch 喂给网络,我也不知道为什么你的程序就运行不了,你可以改写成没有 yield 的形式,每一次从数据头构造batch试试。

AnnaXiong commented 4 years ago

batchTestImageLoader 进入死循环的话,就不会有x_test_t, y_test_t的返回值,直接在这个条件while batch_end < L: 上加个等号就行, 但 while batch_end < L: x_test_t, y_test_t = loadFromList(paths, batch_start, batch_end, labels_to_id, no_of_speakers) yield (x_test_t, y_test_t) batch_start += batch_size batch_end += batch_size 后两句有问题,假如batch_size=10,L(数据总长度)=16,下一次使用next , 从yield后面一句开始运行,batch_start=10, batch_end=20,使用loadFromList,测试数据的后面几个值不就索引不了吗

Walleclipse commented 4 years ago

你好, -- 测试数据的后面几个值不就索引不了吗? 是的,在这一轮后面几个值就无法返回,但是这段代码上面有 np.random.shuffle(paths)这样一句话,意思就是 当 batch_end >= L 以后,重新随机排序数据paths, 之前那次排在靠后的数据,这次可能就在前面了,就可以被返回了。当然数据很少的时候这样做是不太对的,因为每次测试的数据不太一样,但是数据量很大的时候,每次只会去掉小部分数据,影响不大。