Browse Source

add more info for debug

tags/v0.9
Oceania2018 6 years ago
parent
commit
900d45c234
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      test/TensorFlowNET.Examples/TextProcess/TextClassificationTrain.cs

+ 3
- 3
test/TensorFlowNET.Examples/TextProcess/TextClassificationTrain.cs View File

@@ -95,12 +95,12 @@ namespace TensorFlowNET.Examples.CnnTextClassification
//_, step, loss = sess.run([model.optimizer, model.global_step, model.loss], feed_dict = train_feed_dict)
var result = sess.run(new ITensorOrOperation[] { optimizer, global_step, loss }, train_feed_dict);
loss_value = result[2];
var step = result[1];
if (step % 10 == 0)
var step = (int)result[1];
if (step % 10 == 0 || step < 10)
{
var estimate = TimeSpan.FromSeconds((stopwatch.Elapsed.TotalSeconds / i) * total);
Console.WriteLine($"Training on batch {i}/{total}. Estimated training time: {estimate}");
Console.WriteLine($"Step {step} loss: {result[2]}");
Console.WriteLine($"Step {step} loss: {loss_value}");
}

if (step % 100 == 0)


Loading…
Cancel
Save