Browse Source

add debug info

tags/v0.12
Oceania2018 6 years ago
parent
commit
403aa38d04
2 changed files with 7 additions and 1 deletions
  1. +6
    -0
      src/TensorFlowHub/MnistDataSet.cs
  2. +1
    -1
      src/TensorFlowNET.Core/Status/Status.cs

+ 6
- 0
src/TensorFlowHub/MnistDataSet.cs View File

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using NumSharp;
using Tensorflow;
@@ -21,7 +22,12 @@ namespace Tensorflow.Hub

images = images.reshape(images.shape[0], images.shape[1] * images.shape[2]);
images = images.astype(dataType);
// for debug np.multiply performance
var sw = new Stopwatch();
sw.Start();
images = np.multiply(images, 1.0f / 255.0f);
sw.Stop();
Console.WriteLine($"{sw.ElapsedMilliseconds}ms");
Data = images;

labels = labels.astype(dataType);


+ 1
- 1
src/TensorFlowNET.Core/Status/Status.cs View File

@@ -55,7 +55,7 @@ namespace Tensorflow
Console.WriteLine(Message);
if (throwException)
{
// throw new Exception(Message);
throw new Exception(Message);
}
}
}


Loading…
Cancel
Save