-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
little change to the project, then it works well #26
Comments
Hello, everyone! I run the project, and found some problem, and change code as bellow, then it works well. def mfcc_batch_generatorEx(batch_size=10, source=Source.DIGIT_WAVES, target=Target.digits):
2、 in demo.py file, generate all sound features and labels by using bellow X, Y = speech_data.mfcc_batch_generatorEx(batch_size) 3、 in the training step, using code bellow: with tf.Session() as sess: model.save("tflearn.lstm.model") Sorry to the bad format, Thanks for all ! |
Hi. I noticed that you ignored the Validation set in Model.fit function. Why? Can you please describe to me what's the exact process inside Model.fit function? Thanks |
IndentationError: expected an indented block. |
Hello, everyone!
I run the project, and found some problem, and change code as bellow, then it works well.
1, about the mfcc_batch_generator funtion, which generate a batch of sound feature data and labels, but in the trainning step, the data is not updated by the next() in the loop. So I add a new function mfcc_batch_generatorEx simaliar to mfcc_batch_generator in speech_data.py file:
def mfcc_batch_generatorEx(batch_size=10, source=Source.DIGIT_WAVES, target=Target.digits):
maybe_download(source, DATA_DIR)
if target == Target.speaker:
speakers = get_speakers()
batch_features = []
labels = []
files = os.listdir(path)
2、 in demo.py file, generate all sound features and labels by using bellow
X, Y = speech_data.mfcc_batch_generatorEx(batch_size)
3、 in the training step, using code bellow:
with tf.Session() as sess:
model.fit(trainX, trainY, n_epoch=training_iters)#, validation_set=(testX, testY), show_metric=True,batch_size=batch_size)
_y = model.predict(X)
YY = [x.tolist() for x in Y]
corrent_prediction = tf.equal(tf.arg_max(_y,1), tf.arg_max(YY,1))
accuracy = tf.reduce_mean(tf.cast(corrent_prediction, tf.float32))
print("\n\ncorrent_prediction = " , sess.run(accuracy) )
model.save("tflearn.lstm.model")
The text was updated successfully, but these errors were encountered: