diff --git a/test/TensorFlowNET.Examples/BasicModels/NaiveBayesClassifier.cs b/test/TensorFlowNET.Examples/BasicModels/NaiveBayesClassifier.cs index 95197615..70809cc7 100644 --- a/test/TensorFlowNET.Examples/BasicModels/NaiveBayesClassifier.cs +++ b/test/TensorFlowNET.Examples/BasicModels/NaiveBayesClassifier.cs @@ -62,7 +62,7 @@ namespace TensorFlowNET.Examples public void fit(NDArray X, NDArray y) { - var unique_y = y.unique(); + var unique_y = np.unique(y); var dic = new Dictionary>>(); // Init uy in dic diff --git a/test/TensorFlowNET.Examples/ImageProcessing/DigitRecognitionCNN.cs b/test/TensorFlowNET.Examples/ImageProcessing/DigitRecognitionCNN.cs index 6cc972ad..25171974 100644 --- a/test/TensorFlowNET.Examples/ImageProcessing/DigitRecognitionCNN.cs +++ b/test/TensorFlowNET.Examples/ImageProcessing/DigitRecognitionCNN.cs @@ -328,7 +328,7 @@ namespace TensorFlowNET.Examples /// private (NDArray, NDArray) Reformat(NDArray x, NDArray y) { - var (img_size, num_ch, num_class) = (np.sqrt(x.shape[1]), 1, len(np.unique(np.argmax(y, 1)))); + var (img_size, num_ch, num_class) = (np.sqrt(x.shape[1]).astype(np.int32), 1, len(np.unique(np.argmax(y, 1)))); var dataset = x.reshape(x.shape[0], img_size, img_size, num_ch).astype(np.float32); //y[0] = np.arange(num_class) == y[0]; //var labels = (np.arange(num_class) == y.reshape(y.shape[0], 1, y.shape[1])).astype(np.float32);