c# - 将 ML.net 与 ONNX 模型和 GPU 一起使用
问题描述
如何使用 C# 让 Microsof.tML 在 NVDIA GPU 上运行?我按照指示
https://github.com/dotnet/machinelearning/blob/master/docs/api-reference/tensorflow-usage.md
我的管道如下所示。所有版本依赖项(onnxruntime.gpu、Microsoft.ML 等)都是 1.5.2,因此应该支持它,但我得到异常 DllNotFoundException:无法加载 DLL 'onnxruntime' 或其依赖项之一:找不到指定的模块 -是的 onnxruntime 确实出现在已安装的 nuget 包列表中。
有没有人让这个工作?文档仍然很稀疏,并且似乎没有任何在线示例。
var pipeline = context.Transforms.ResizeImages(
resizing: ImageResizingEstimator.ResizingKind.Fill,
outputColumnName: "image", imageWidth: ImageSettings.imageWidth,
imageHeight: ImageSettings.imageHeight,
inputColumnName: nameof(ModelInput.Image)
)
.Append(context.Transforms.ExtractPixels(outputColumnName: "image"))
.Append(context.Transforms.ApplyOnnxModel(
modelFile: "./ObjectDetection/tinyyolov2-8.onnx",
outputColumnName: "grid",
inputColumnName: "image",
gpuDeviceId:0)
);
解决方案
好的 - 回答我自己的问题的形式不好,但上面的链接说你必须使用 Cuda 10 似乎不准确。如果您使用的是 ML.net 1.5 nuget 版本,则需要 Cuda 10.2。
除非您从源代码构建(以及谁有时间),否则 11 将无法工作。
希望这可以解决它,但如果您要发表评论,请也这样做!
推荐阅读
- r - parSapply 错误。功能在没有并行的情况下工作
- html - 向html输入添加多个名称?
- javascript - 网页和图像到带有水印的pdf转换
- excel - 在每次输入后计算匹配的单元格
- java - 按组排序,然后根据组在两个字段上排序
- python - 只需要第一次出现特定标签时解析 html 的有效方法
- spring-boot - 运行 Springboot + JSF App 失败并出现 MalformedParameterizedTypeException
- r - 了解 dfm_groups 如何在未添加组的情况下工作
- r - ggplot2中的特定字体未保存到pdf错误
- r - R:如何读取和重新排列多个文件