[译]TensorFlow-使用TensorFlowSharp创建C#应用程序
By robot-v1.0
本文链接 https://www.kyfws.com/ai/tensorflow-creating-csharp-applications-using-zh/
版权声明 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
- 15 分钟阅读 - 7505 个词 阅读量 0TensorFlow-使用TensorFlowSharp创建C#应用程序(译文)
原文地址:https://www.codeproject.com/Articles/5164135/TensorFlow-Creating-Csharp-Applications-using
原文作者:Sau002
译文由本站 robot-v1.0 翻译
前言
How to create C# applications using TensorFlowSharp
如何使用TensorFlowSharp创建C#应用程序
目录(Table of Contents)
-
关于TensorflowSharp-从C#应用程序使用Tensorflow(About TensorflowSharp-Using Tensorflow from a C# Application)
-
使用TensorFlow和Python训练CNN模型(Training a CNN Model using TensorFlow and Python)
- CNN架构(CNN Archictecture)
- 用于训练的图像文件(Image Files Used for Training)
- 1-Python脚本(MnistImageLoader.py)(1-Python Script (MnistImageLoader.py))
- 2-加载训练图像(TrainMnistFromFolder.py)(2-Loading the Training Images (TrainMnistFromFolder.py))
- 3-创建CNN模型(TrainMnistFromFolder.py)(3-Create the CNN Model (TrainMnistFromFolder.py))
- 4-训练模型(TrainMnistFromFolder.py)(4-Train the Model (TrainMnistFromFolder.py))
- 5-将模型保存到文件(TrainMnistFromFolder.py)(5-Save the Model to File (TrainMnistFromFolder.py))
- 6结果(6-Results)
-
在C#控制台应用程序中使用Tensorflow(Using Tensorflow in a C# Console Application)
介绍(Introduction)
在模式识别领域,近5年以来,深度神经网络日益受到关注.这在很大程度上归因于更便宜的硬件,编程库和标记数据的可用性.如果训练有素,深度神经网络或卷积神经网络(CNN)可以产生惊人的效果. Google的TensorFlow是一种非常流行的库,它实现了其中的一些复杂算法.(In the field of pattern recognition, deep neural networks have gained prominence in the last 5 years. This can be largely attributed to the availability of cheaper hardware, programming libraries and labelled data. Deep neural networks or Convolutional neural networks (CNN) if trained properly can give spectacular results. TensorFlow from Google is one the very popular libraries that implement some of these complicated algorithms.)
在本文中,我将演示如何训练CNN模型以识别MNIST数据库中的手写数字.这之后将是一个C#控制台应用程序,该应用程序将使用训练后的模型对MNIST数据集中的测试图像进行实际分类.本文的目的是演示如何充分利用Python来训练模型,以及.NET来构建假设的最终用户应用程序,该应用程序使用训练后的模型.(In this article, I am going to demonstrate how to train a CNN model to recognize handwritten digits from the MNIST database. This will be followed by a C# console application which will consume the trained model to actually classify the test images from the MNIST dataset. The objective of this article is to demonstrate how to make the best use of Python for training a model and .NET to build a hypothetical end user application which consumes the trained model.)
关于TensorFlow(About TensorFlow)
TensorFlow本机库(TensorFlow Native Library)
///
///https://www.tensorflow.org/install/lang_c
///The windows native implementation is downloadable as a single ZIP and structured as follows
///
include
--------
|
|
|
--c_api.h
|
|
lib
--------
|
|
--tensorflow.dll
|
|
--tensorflow.lib
适用于Python和C#的TensorFlow绑定(TensorFlow Bindings for Python and C#)
Tensorflow被实现为C/C ++动态链接库.特定于平台的二进制文件位于ZIP文件中.该库的顶部提供了各种语言的绑定.这些是特定于语言的包装器,它们调用本机库. Python可能是在本机TensorFlow实现之上构建的功能最多的编程层之一. TensorFlowSharp是TensorFlow的.NET包装器.(Tensorflow is implemented as C/C++ dynamic link library. Platform specific binaries are available in a ZIP file. Bindings in various languages are provided on top of this library. These are language specific wrappers which invoke the native libraries. Python is perhaps one of the most versatile programming layers built on top of the native TensorFlow implementations. TensorFlowSharp is the .NET wrapper over TensorFlow.)
TensorFlow(C/C++)
----------------
|
|
------------------------------------------------
| |
| |
| |
Python TensorFlowSharp(C#)
------ -------------------
(train model) (use model in client application)
背景(Background)
- 蟒蛇(Python)-我使用Python使用MNIST手写数字数据集来训练CNN模型.必须具备Python的基本知识.我用过(- I have used Python for training a CNN model using the MNIST dataset of handwritten digits. A basic knowledge of Python would be essential. I have used)Visual Studio代码(1.36.1)(Visual Studio Code (1.36.1))用于Python脚本.您可以使用任何适合您的Python编辑器.(for the Python scripts. You can use any Python editor that suits you.)
- 我用过(I have used)Visual Studio 2017(Visual Studio 2017)用于简单的控制台应用程序,该应用程序使用经过训练的模型并对测试图像进行分类.(for the simple Console application which consumes the trained model and classifies the test images.)
- 在本文中,我使用了(In this article, I have used the)显卡(GPU)Tensorflow版本以提高学习速度.您需要一个(version of the Tensorflow for to improve the speed of learning. You would need a)显卡(GPU)已启用的桌面.请读者注意,使用GPU进行编码需要额外的操作(enabled desktop. The reader is cautioned that coding with the GPU requires additional)卡达(CUDA)库和要安装的驱动程序.本文还假定读者熟悉以下内容的基本原理:(libraries and drivers to be installed. This article also assumes that the reader is familiar with the basic principles of)深度卷积神经网络(Deep Convolution Neural Networks).(.) 最佳(Top)
什么是MNIST?为什么选择MNIST?(What is MNIST? Why MNIST?)
总览(Overview)
MNIST数据库是手写数字(0-9)的集合.其中包括60,000个培训和10,000个测试图像.每个图像为28像素宽和28像素高,并且所有图像均为灰度级.在机器学习和计算机视觉的世界中,MNIST已成为测试任何新范例的事实上的标准. (参考(MNIST database is a collection of handwritten digits (0-9). This comprises 60,000 training and 10,000 testing images. Each of the images is 28 pixels wide and 28 pixels high and all the images are in gray scale. In the world of machine learning and computer vision, MNIST has become the de facto standard to test any new paradigm. (Reference) http://yann.lecun.com/exdb/mnist/(http://yann.lecun.com/exdb/mnist/) )())
示例图片(Example Pictures)
图片分配(Distribution of Pictures)
0(0) | 1个(1) | 2(2) | 3(3) | 4(4) | 5(5) | 6(6) | 7(7) | 8(8) | 9(9) | |
---|---|---|---|---|---|---|---|---|---|---|
Training | 5923 | 6742 | 5985 | 6131 | 5842 | 5421 | 5918 | 6265 | 5851 | 5949 |
Testing | 980 | 1135 | 1032 | 1010 | 982 | 892 | 958 | 1028 | 974 | 1009 |
深度学习(Deep Learning)
感知器(Perceptrons)
在1940年代和50年代,非常基本的数学神经元的思想开始形成.研究人员(McCulloch,Pitts和Rosenblatt)从生物神经元的工作中获得了启发.神经元是神经系统的基础.一个普通的人脑中有数十亿个神经元通过突触彼此间接连接.他们设想单个神经元的行为类似于直线分类器.流入树枝状晶体的电信号代表真实信号(矢量),输出信号代表分类的二进制(开/关)状态. Frank Rosenblatt(1962)在他的书<神经动力学原理>(1962年出版,“完全线性感知器"部分)中提出了线性感知器的设计,从而使McCulloch和Pitts神经元的设计向前迈进了一步.(In the 1940s and 50s the idea of a very basic mathematical neuron began to take shape. Researchers (McCulloch, Pitts and Rosenblatt) drew inspiration from the working of a biological neuron. Neurons are the building blocks of the nervous system. An average human brain has several billions of neurons indirectly connected to each other through synapses. They envisioned an individual neuron to behave like a straight-line classifier. The electric signals flowing in through the dendrites represented a real-life signal (vector) and the output signal would represent a binary (on/off) state of classification. Frank Rosenblatt (1962) took the design of McCulloch and Pitts neuron a step forward by proposing the design of the linear perceptron in his book Principles of Neurodynamics (published 1962, Section “Completely linear perceptrons”).)
单感知器(Single Perceptron)
蓝色圆圈表示a.x + b.y + c =0形式的直线方程.(The blue circle represents the equation of a straight line in the form of a.x+b.y+c=0.)
给定两类线性可分离的点X和O,您可以找到一条直线将两类分开.如果将X类中的点的坐标输入方程a.x + b.y + c,然后对O类中的所有点进行相同的处理,那么您将看到X类中的所有点都产生一个正值,而O类中的所有点都产生负值(反之亦然).符号的变化可能是相反的,取决于常数a,b和c.然而,这是使Perceptron表现为线性分类器的总体原则.(Given two classes of points X and O, which are linearly separable, you can find a straight line which divides the 2 classes. If you feed in the coordinates of the points in class X to the equation a.x+b.y+c and then do the same for all points in class O, then you are going to see that all points in class X produce a positive value, while all points in class O produce a negative value (or vice versa). The change of sign could be the other way round, depending on the constants a, b and c. Nevertheless, this is the overarching principle which goes to make the Perceptron behave as a linear classifier.)
多层感知器(Multi Layer Perceptrons)
如果像在著名的XOR问题的情况下那样,无法找到将类X和O分开的一行,则可以层叠多个线性分类器.(If we are unable to find a single line that separates the classes X and O , as in the case of the famous XOR problem, then we could cascade multiple linear classifiers.)
卷积神经网络(Convolutional Neural Networks)
深度学习通过结合特征提取和超平面发现使多层感知器向前迈进了一步.这些特征是由过滤器层提取的.有关此主题的详尽论述,请读者阅读Andrew Ng的教程.(Deep learning takes a multi layer perceptron a step forward by combining feature extraction and hyperplane discovery. The features are extracted by layers of filters. For a thorough treatise on this subject, the reader is requested to follow Andrew Ng’s tutorials.)
TensorflowSharp-从C#应用程序使用Tensorflow(TensorflowSharp - Using Tensorflow from a C# Application)
TensorFlowSharp是对TensorFlow的非托管本机库的.NET包装.这是(TensorFlowSharp is a .NET wrapper over the unmanaged native libraries of TensorFlow. This is the outcome of the pioneering work done by) 米格尔`德伊卡萨(Miguel de lcaza) . TensorFlowSharp可以使用使用Python训练的CNN模型,这为创建令人兴奋的最终用户应用程序提供了可能性.(. TensorFlowSharp can consume a CNN model that was trained using Python and this opens up the possibility to create exciting end user applications.)
nuget install TensorFlowSharp
///
///Skeletal code using TensorFlowSharp
///
byte[] buffer = System.IO.File.ReadAllBytes(modelfile);
using (var graph = new TensorFlow.TFGraph())
{
graph.Import(buffer);
using (var session = new TensorFlow.TFSession(graph))
{
/*
1)pick a test image
2)Created tensor object using this image
*/
var runner = session.GetRunner();
runner.AddInput(...,tensor,)
runner.Fetch(...)
var output = runner.Run();
}
}
在GPU中使用Tensorflow(Using Tensorflow with GPU)
总览(Overview)
Python script
--------------
|
|
|
TensorFlow GPU package
----------------------
|
|
|
cuDNN
-----
|
|
|
CUDA Toolkit
--------------
|
|
|
Drivers
-------
|
|
|
GPU
---
GPU/NVDIA-对我有用的是什么?(GPU/NVDIA-What Worked For Me?)
使用TensorFlow进行训练时,您可以选择使用CPU软件包还是GPU软件包.首选GPU,因为训练速度明显更快.您将需要正确版本的NVIDIA驱动程序和CUDA库.根据经验,NVIDIA驱动程序的版本应与TensorFlow的当前版本匹配.在撰写本文时,我已经使用了python包TensorFlow-GPU 1.14.0.我会警告读者,我在安装驱动程序和使TensorFlow GPU正常工作方面的经验并不顺利.(When using TensorFlow for training, you have the choice of using either the CPU package or the GPU package. The GPU is preferred because the training speed is significantly faster. You will need the correct version of NVIDIA drivers and CUDA libraries. As a rule of thumb, the version of NVIDIA drivers should match the current version of TensorFlow. At the time of writing this article, I have used the python package TensorFlow-GPU 1.14.0. I would caution the reader that my experience with installing the drivers and getting TensorFlow GPU to work was less than smooth.)
-
更新NVIDIA驱动程序的版本.我没有通过NVIDIA网站安装.我通过Windows设备管理器用户界面更新了显示适配器.版本24.21.14.1131为我工作.(Update the version of the NVIDIA drivers. I did not install through NVIDIA web site. I updated the display adapter through the Windows Device Manager user interface. The version 24.21.14.1131 worked for me.)
-
安装CUDA Toolkit 10.0版本(Install CUDA Toolkit 10.0 version)
-
安装cuDNN SDK版本7.6.2.我选择了Windows 10版本.我复制了(Install cuDNN SDK version 7.6.2. I chose the Windows 10 edition. I copied over)cudnn64_7.dll(cudnn64_7.dll)至(to)%ProgramFiles%\ NVIDIA GPU计算工具包\ CUDA \ v10.0 \ bin(%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin)
-
Python包Tensorflow 1.14(Python package Tensorflow 1.14)
-
Python软件包Keras 2.2.4(Python package Keras 2.2.4)
-
Python软件包Numpy 1.16.1(Python package Numpy 1.16.1) 最佳(Top)
使用TensorFlow和Python训练CNN模型(Training a CNN Model using TensorFlow and Python)
CNN架构(CNN Architecture)
Input layer (28X28,1 channel)
-----------------------------
|
|
|
Convolution layer (5X5,20,RELU)
--------------------------------
|
|
|
Max Pool layer (2X2,stride=2)
------------------------------
|
|
|
Convolution layer (5X5,50,RELU)
--------------------------------
|
|
|
Max Pool layer (2X2,stride=2)
-----------------------------
|
|
|
Flatten
---------
|
|
|
Dense layer (500 nodes,RELU)
----------------------------
|
|
|
Dense layer (10 nodes,RELU)
----------------------------
|
|
|
Output layer(Softmax)
----------------------
用于训练的图像文件(Image Files Used for Training)
MNIST数据集可以从(MNIST dataset can be readily accessed from the) scikit学习(scikit-learn) 包.但是,在本教程中,我演示了如何从磁盘加载图像.单独的PNG文件在随附的项目中可用(package. However, in this tutorial, I have demonstrated how to load the images from disk. The individual PNG files are made available in the accompanying project)MNISpng.csproj(MNISpng.csproj). python脚本,(. The python script,)**MnistImageLoader.py(MnistImageLoader.py)**将在目录结构中枚举并构建培训/测试图像列表.每个PNG文件的父文件夹将提供训练标签(0-9).(will be enumerated over the directory structure and build a list of training/testing images. The parent folder of each PNG file will provide the training label (0-9).)
MNIST
-----
|
|
training.zip
-----------
| |
| |
| |--(folders 0 to 9)
| |
| |
| |_0
| |
| |
| |_1
| |
| |
| |_2
| .
| .
| ._9
|
|
testing.zip
-----------
|
|
|--(folders 0 to 9)
1-Python脚本(MnistImageLoader.py)(1-Python Script (MnistImageLoader.py))
#
#Load images and labels. Returns a tuple of image data,label
#
def load_images(path_in):
filenames = glob.glob(path_in)
images=[]
labels=[] #labels for each training file
filenames = glob.glob(path_in)
for filename in filenames:
#get the parent folder from the full path of the
#file /mnist/blah/training/3/34348.png
fulldir=os.path.dirname(filename)
parentfolder=os.path.basename(fulldir)
imagelabel=int(parentfolder)
labels.append(imagelabel)
img = get_im(filename)
images.append(img)
return images,labels
#
#The output from load_images() is further refined
#
def ReShapeData(data,target,numclasses):
data_out = np.array(data, dtype=np.uint8)
target_out = np.array(target, dtype=np.uint8)
data_out = data_out.reshape(data_out.shape[0], 28,28)
data_out = data_out[:, :, :, np.newaxis]
data_out = data_out.astype('float32')
data_out /= 255
target_out = np_utils.to_categorical(target_out, numclasses)
return data_out,target_out
2-加载训练图像(TrainMnistFromFolder.py)(2-Loading the Training Images (TrainMnistFromFolder.py))
主python脚本(The master python script)**TrainMnistFromFolder.py(TrainMnistFromFolder.py)**将调用函数(will call the functions) load_images
和(and) ReShapeData
.(.)
#
#Load training images
#
from MnistImageLoader import load_images,ReShapeData
print("Loading training images")
(train_data, train_target)=load_images(mnist_train_path_full)
(train_data1,train_target1)=ReShapeData(train_data,train_target,nb_classes)
print('Shape:', train_data1.shape)
print(train_data1.shape[0], ' train images were loaded')
3-创建CNN模型(TrainMnistFromFolder.py)(3-Create the CNN Model(TrainMnistFromFolder.py))
#
# Create a sequential model
#
model = Sequential()
# Add the first convolution layer
model.add(Convolution2D(
name="conv1",
filters = 20,
kernel_size = (5, 5),
padding = "same",
input_shape = (28, 28, 1)))
# Add a ReLU activation function
model.add(Activation(
activation = "relu"))
# Add a pooling layer
model.add(MaxPooling2D(
name="maxpool1",
pool_size = (2, 2),
strides = (2, 2)))
# Add the second convolution layer
model.add(Convolution2D(
name="conv2",
filters = 50,
kernel_size = (5, 5),
padding = "same"))
# Add a ReLU activation function
model.add(Activation(
activation = "relu"))
# Add a second pooling layer
model.add(MaxPooling2D(
name="maxpool2",
pool_size = (2, 2),
strides = (2, 2)))
# Flatten the network
model.add(Flatten())
# Add a fully-connected hidden layer
model.add(Dense(500))
# Add a ReLU activation function
model.add(Activation(activation = "relu"))
# Add a fully-connected output layer - the output layer nodes
# should match the count of image classes
model.add(Dense(nb_classes,name="outputlayer"))
# Add a softmax activation function
model.add(Activation("softmax"))
#
#Display Summary
#
model.summary()
# Compile the network
model.compile(
loss = "categorical_crossentropy",
optimizer = SGD(lr = 0.01),
metrics = ["accuracy"])
print("Compilation complete");
4火车模型(TrainMnistFromFolder.py)(4-Train Model (TrainMnistFromFolder.py))
#
# Train the model
#
total_epochs=20
start = time.time()
model.fit(
train_data1,
train_target1,
batch_size = 128,
epochs = total_epochs,
verbose = 1)
print("Train complete");
#
#Test the model
#
print("Testing on test data")
(loss, accuracy) = model.evaluate(
test_data1,
test_target1,
batch_size = 128,
verbose = 1)
# Print the model's accuracy
print("Accuracy="+ str(accuracy))
5-保存模型(FreezeKerasToTF.py)(5-Save the Model (FreezeKerasToTF.py))
训练完成后,必须以原始TensorFlow格式保存模型((After training is complete, the model has to be saved in the original TensorFlow format ().pb(.pb)).功能(). The function) freeze_session
在文件中(in the file)**FreezeKerasToTF.py(FreezeKerasToTF.py)**为我们做到这一点.保存的模型包含网络布局和权重.(does this for us. The saved model contains the network layout and the weights.)
#
#Saving using Freeze approach
#https://stackoverflow.com/questions/45466020/how-to-export-keras-h5-to-tensorflow-pb
#
frozen_graph = freeze_session(K.get_session(),
output_names=[out.op.name for out in model.outputs])
tf.train.write_graph(frozen_graph, "Out", "Mnist_model.pb", as_text=False)
6结果(6-Results)
C#控制台应用程序(C# Console Application)
总览(Overview)
-----------------------
1)Load trained model file
-----------------------
|
|
-----------------
2)Load test images
-----------------
|
|
-----------------------------------
3)Evaluate the test image using CNN
-----------------------------------
1-创建控制台应用程序(1-Create a Console Application)
- 使用.NET Framework(64位,4.6.1或更高版本)创建新的控制台应用程序(Create a new Console application using .NET Framework (64 bit, 4.6.1 or above))
- 将NUGET包引用添加到TensorflowSharp(Add NUGET package reference to TensorflowSharp) 最佳(Top)
2-加载训练过的模型文件(2-Load the Trained Model File)
///
///Skeletal code using TensorFlowSharp
///
var modelfile=@"c:\\MyTensorFlowModel.pb";//Produced by training
byte[] buffer = System.IO.File.ReadAllBytes(modelfile);
using (var graph = new TensorFlow.TFGraph())
{
graph.Import(buffer);
using (var session = new TensorFlow.TFSession(graph))
{
var file="test.png";
var runner = session.GetRunner();
var tensor = Utils.ImageToTensorGrayScale(file);
runner.AddInput(graph["conv1_input"][0], tensor);
runner.Fetch(graph["activation_4/Softmax"][0]);
var output = runner.Run();
var vecResults = output[0].GetValue();
float[,] results = (float[,])vecResults;
///
/// Evaluate the results
///
int[] quantized = Utils.Quantized(results);
}
}
3-Utils.ImageToTensorGrayScale(3-Utils.ImageToTensorGrayScale)
此函数将加载MNIST图片文件并创建TFTensor:(This function will load a MNIST picture file and create a TFTensor:)
public static TensorFlow.TFTensor ImageToTensorGrayScale(string file)
{
using (System.Drawing.Bitmap image = (System.Drawing.Bitmap)System.Drawing.Image.FromFile(file))
{
var matrix = new float[1, image.Size.Height, image.Size.Width, 1];
for (var iy = 0; iy < image.Size.Height; iy++)
{
for (int ix = 0, index = iy * image.Size.Width; ix < image.Size.Width; ix++, index++)
{
System.Drawing.Color pixel = image.GetPixel(ix, iy);
matrix[0, iy, ix, 0] = pixel.B / 255.0f;
}
}
TensorFlow.TFTensor tensor = matrix;
return tensor;
}
}
4U量化(4-Utis.Quantized)
此函数会将TF结果转换为包含10个元素的数组. 0(This function will convert the TF result into an array with 10 elements. The 0)日(th)元素表示数字0和元素9的概率(element represents the probability for digit 0 and element 9)日(th)表示数字9的概率.(represents the probability for digit 9.)
//Silly repetitions here! I was running out of time.
internal static int[] Quantized(float[,] results)
{
int[] q = new int[]
{
results[0,0]>0.5?1:0,
results[0,1]>0.5?1:0,
results[0,2]>0.5?1:0,
results[0,3]>0.5?1:0,
results[0,4]>0.5?1:0,
results[0,5]>0.5?1:0,
results[0,6]>0.5?1:0,
results[0,7]>0.5?1:0,
results[0,8]>0.5?1:0,
results[0,9]>0.5?1:0,
};
return q;
}
5结果(5-Results)
遍历所有10,000张测试图像并通过MNIST对它们进行分类后,我们获得了98.5%的预测成功率. 150张图像分类错误.按照(After iterating over all the 10,000 test images and classifying each of them through MNIST, we get a prediction success rate of 98.5%. 150 images were misclassified. As per) MNIST主页(MNIST home page) ,最新的基准测试成功率超过99.5%.(, the state of the art benchmark is over 99.5% success rate.)
使用代码(Using the Code)
Github仓库(Github Repository)
解决方案结构(Solution Structure)
Solution
--------
|
|
MNISTPng (ZIP of individual PNG train and test files)
------------------------------------------------------
|
|
PythonTrainer (Python script to train using TensorFlow)
-------------------------------------------------------
|
|
ConsoleAppTester (C# console app using TensorFlowSharp)
-------------------------------------------------------
1-Python培训师(1-PythonTrainer)
用于训练CNN模型的Python脚本:(Python scripts for training a CNN model:)
- TrainMnistFromFolder.py(TrainMnistFromFolder.py)-最外层的Python脚本,可加载和训练图像(- Outermost Python script which loads and trains the images)
- MnistImageLoader.py(MnistImageLoader.py)-对于将PNG转换为张量很有用(- Useful for converting a PNG into a Tensor)
- FreezeKerasToTF.py(FreezeKerasToTF.py)-对于将经过训练的模型另存为(- Useful for saving a trained model as)**.PB(.PB)**文件(file)
2-MNISTPng(2-MNISTPng)
培训和测试图像的ZIP:(ZIP of training and testing images:)
- testing.zip(testing.zip)-将10,000个单独的测试文件组织到10个目录中(- 10,000 individual testing files organized into 10 directories)
- training.zip(training.zip)-将50,000个单独的培训文件组织到10个目录中(- 50,000 individual training files organized into 10 directories)
3-ConsoleAppTester(3-ConsoleAppTester)
C#EXE,它将使用TensorFlowSharp加载经过训练的模型(C# EXE which will use TensorFlowSharp to load the trained model)
兴趣点(Points of Interest)
许可
本文以及所有相关的源代码和文件均已获得The Code Project Open License (CPOL)的许可。
Python C# .NET machine-learning 新闻 翻译