用keras保存的ML.NET加载模型

编程入门 行业动态 更新时间:2024-10-23 20:30:56
本文介绍了用keras保存的ML.NET加载模型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个用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加载模型

本文发布于:2023-11-10 09:45:43,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1575041.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:模型   加载   keras   ML   NET

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!