【问题标题】:Cannot find the ONNX file specified using WinML找不到使用 WinML 指定的 ONNX 文件
【发布时间】:2018-07-27 23:24:47
【问题描述】:

我正在尝试使用 WinML 加载 ONNX 模型,代码如下:

private async Task InitializeModelAsync()
{
    var path = @"ms-appx:///Assets/FER-Emotion-Recognition.onnx";
    var file = await StorageFile.GetFileFromApplicationUriAsync(new Uri(path));
    model = await CNTKGraphModel.CreateCNTKGraphModel(file);
}

项目编译正常,但在运行时我得到一个 System.IO.FileNotFoundException

系统找不到指定的文件。

我仔细检查了,但文件确实在正确的文件夹中。我做错了什么?

【问题讨论】:

  • 您是否将文件设置为内​​容?
  • 尝试将文件复制到LocalFolder。

标签: c# windows-10 onnx windows-machine-learning


【解决方案1】:

右键单击您的onnx 文件,转到“属性”面板并将其构建操作设置为内容。

然后,将 Copy to Output Directory 设置为 Copy if newer.

Get started with Machine Learning

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-03-17
    • 2012-04-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-12-31
    相关资源
    最近更新 更多