我有一个用Keras用Python实现的神经网络.培训之后,我就导出了模型,并得到了两个文件:model.js和model.h5.现在,我想在.NET项目中进行实时分类,并希望使用经过训练的神经网络.
I have a Neural Network implemented in Python with Keras. Once I have trained it I have exported the model and I have got two files: model.js and model.h5. Now I want to classify in real time inside a .NET project and I want to use the trained Neural Network for it.
在ML.NET中,有没有一种方法可以将通过python导出的模型和训练后的权重加载到模型对象中?
Is there a way in ML.NET of loading the model and trained weights exported with python into a model object?
我在文档[1]中看到可以加载以前保存的模型,但是显然是以.zip格式存储的,我找不到格式(也许是从python和'将其转换为ML.NET模型.
I have seen in the documentation[1] that a previous saved model can be loaded, but apparently is storage in a .zip and I could not find the format (maybe to make a script that takes the model from python and 'translate' it to the ML.NET model.
hdf5格式显然是一种标准[2],有没有办法用ML.NET加载它?
Apparently the hdf5 format is a standard[2], there is a way to load it with ML.NET?
[1] docs.microsoft/zh-CN/dotnet/machine-learning/how-to-guides/using-model-ml-net
[2] support.hdfgroup/HDF5/doc1.6/UG/10_Datasets.html
推荐答案ML支持ONNX模型.
ML supports ONNX models.
github/dotnet/machinelearning-samples/tree/master/samples/csharp/getting-started/DeepLearning_ObjectDetection_Onnx
您可以通过 WinMLTools
更多推荐
用keras保存的ML.NET加载模型
发布评论