Giter VIP home page Giter VIP logo

microsoft / windows-machine-learning Goto Github PK

View Code? Open in Web Editor NEW
991.0 71.0 442.0 528.5 MB

Samples and Tools for Windows ML.

Home Page: https://docs.microsoft.com/en-us/windows/ai/

License: MIT License

C++ 48.33% C# 3.68% C 20.62% JavaScript 1.91% Python 1.42% CSS 0.66% HTML 0.33% TypeScript 22.80% Batchfile 0.25%
machine-learning ai ml deep-learning neural-network onnx windows keras tensorflow coreml

windows-machine-learning's Introduction

Windows Machine Learning

Windows Machine Learning is a high-performance machine learning inference API that is powered by ONNX Runtime and DirectML.

Alt text

The Windows ML API is a Windows Runtime Component and is suitable for high-performance, low-latency applications such as frameworks, games, and other real-time applications as well as applications built with high-level languages.

This repo contains Windows Machine Learning samples and tools that demonstrate how to build machine learning powered scenarios into Windows applications.

For additional information on Windows ML, including step-by-step tutorials and how-to guides, please visit the Windows ML documentation.

Sample/Tool Status
All Samples Build Status
WinmlRunner Build Status
WinML Dashboard Build Status

Getting Started with Windows ML

Prerequisites

Windows ML offers machine learning inferencing via the inbox Windows SDK as well as a redistributable NuGet package. The table below highlights the availability, distribution, language support, servicing, and forward compatibility aspects of the In-Box and NuGet package for Windows ML.

In-Box NuGet
Availability Windows 10 - Build 17763 (RS5) or Newer
For more detailed information about version support, checkout our docs.
Windows 8.1 or Newer
NOTE: Some APIs (ie: VideoFrame) are not available on older OSes.
Windows SDK Windows SDK - Build 17763 (RS5) or Newer Windows SDK - Build 17763 (RS5) or Newer
Distribution Built into Windows Package and distribute as part of your application
Servicing Microsoft-driven (customers benefit automatically) Developer-driven
Forward compatibility Automatically rolls forward with new features Developer needs to update package manually

Learn more here.

Model Samples

In this section you will find various model samples for a variety of scenarios across the different Windows ML API offerings.

Image Classification

A subdomain of computer vision in which an algorithm looks at an image and assigns it a tag from a collection of predefined tags or categories that it has been trained on.

Windows App Type
Distribution
UWP
In-Box
UWP
NuGet
Desktop
In-Box
Desktop
NuGet
AlexNet ✔️C# .NET5 - Samples Gallery
CaffeNet ✔️C# .NET5 - Samples Gallery
DenseNet ✔️C# .NET5 - Samples Gallery
EfficientNet ✔️C# .NET5 - Samples Gallery
GoogleNet ✔️C# .NET5 - Samples Gallery
InceptionV1 ✔️C# .NET5 - Samples Gallery
InceptionV2 ✔️C# .NET5 - Samples Gallery
MNIST ✔️C++/CX
✔️C#
MobileNetV2 ✔️C# .NET5 - Samples Gallery
RCNN ✔️C# .NET5 - Samples Gallery
ResNet50 ✔️C# .NET5 - Samples Gallery
ShuffleNetV1 ✔️C# .NET5 - Samples Gallery
ShuffleNetV2 ✔️C# .NET5 - Samples Gallery
SqueezeNet ✔️C#
✔️JavaScript
✔️C++/WinRT
✔️C# .NET5
✔️C# .NET Core 2
✔️C++/WinRT
✔️C# .NET5 - Samples Gallery
✔️Rust
VGG19 ✔️C# .NET5 - Samples Gallery
VGG19bn ✔️C# .NET5 - Samples Gallery
ZFNet512 ✔️C# .NET5 - Samples Gallery

Style Transfer

A computer vision technique that allows us to recompose the content of an image in the style of another.

Windows App Type
Distribution
UWP
In-Box
UWP
NuGet
Desktop
In-Box
Desktop
NuGet
FNSCandy ✔️C# - FNS Style Transfer
✔️C# - Real-Time Style Transfer

Advanced Scenario Samples

These advanced samples show how to use various binding and evaluation features in Windows ML:

  • Custom Tensorization: A Windows Console Application (C++/WinRT) that shows how to do custom tensorization.

  • Custom Operator (CPU): A desktop app that defines multiple custom cpu operators. One of these is a debug operator which we invite you to integrate into your own workflow.

  • Adapter Selection: A desktop app that demonstrates how to choose a specific device adapter for running your model.

  • Plane Identifier: a UWP app and a WPF app packaged with the Desktop Bridge, sharing the same model trained using Azure Custom Vision service. For step-by-step instructions for this sample, please see the blog post Upgrade your WinML application to the latest bits.

  • Custom Vision and Windows ML: The tutorial shows how to train a neural network model to classify images of food using Azure Custom Vision service, export the model to ONNX format, and deploy the model in a Windows Machine Learning application running locally on Windows device.

  • ML.NET and Windows ML: This tutorial shows you how to train a neural network model to classify images of food using ML.NET Model Builder, export the model to ONNX format, and deploy the model in a Windows Machine Learning application running locally on a Windows device.

  • PyTorch Data Analysis: The tutorial shows how to solve a classification task with a neural network using the PyTorch library, export the model to ONNX format and deploy the model with the Windows Machine Learning application that can run on any Windows device.

  • PyTorch Image Classification: The tutorial shows how to train an image classification neural network model using PyTorch, export the model to the ONNX format, and deploy it in a Windows Machine Learning application running locally on your Windows device.

  • YoloV4 Object Detection: This tutorial shows how to build a UWP C# app that uses the YOLOv4 model to detect objects in video streams.

Developer Tools

  • Model Conversion

    Windows ML provides inferencing capabilities powered by the ONNX Runtime engine. As such, all models run in Windows ML must be converted to the ONNX Model format. Models built and trained in source frameworks like TensorFlow or PyTorch must be converted to ONNX. Check out the documentation for how to convert to an ONNX model:

  • Model Optimization

    Models may need further optimizations applied post conversion to support advanced features like batching and quantization. Check out the following tools for optimizing your model:

    • WinML Dashboard (Preview): a GUI-based tool for viewing, editing, converting, and validating machine learning models for Windows ML inference engine. This tool can be used to enable free dimensions on models that were built with fixed dimensions. Download Preview Version

    • Graph Optimizations: Graph optimizations are essentially graph-level transformations, ranging from small graph simplifications and node eliminations to more complex node fusions and layout optimizations.

    • Graph Quantization: Quantization in ONNX Runtime refers to 8 bit linear quantization of an ONNX model.

  • Model Validation

    • WinMLRunner: a command-line tool that can run .onnx or .pb models where the input and output variables are tensors or images. It is a very handy tool to quickly validate an ONNX model. It will attempt to load, bind, and evaluate a model and print out helpful messages. It also captures performance measurements.

      Download x64 Exe

  • Model Integration

    • WinML Code Generator (mlgen): a Visual Studio extension to help you get started using WinML APIs on UWP apps by generating a template code when you add a trained ONNX file into the UWP project. From the template code you can load a model, create a session, bind inputs, and evaluate with wrapper codes. See docs for more info.

      Download for VS 2017, VS 2019

    • WinML Samples Gallery: explore a variety of ML integration scenarios and models.

    • Check out the Model Samples and Advanced Scenario Samples to learn how to use Windows ML in your application.

Feedback

External Links

Contributing

We're always looking for your help to fix bugs and improve the samples. Create a pull request, and we'll be happy to take a look.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

windows-machine-learning's People

Contributors

adele101 avatar alexzakv avatar eliotcowley avatar ericleigh007 avatar fdwr avatar janezdu avatar jeffbloo avatar kumraj avatar laks0209 avatar linnealovespie avatar lovettchris avatar lpbourret avatar martinb35 avatar mattwojo avatar mccoykillian avatar ngeisler11 avatar nums11 avatar orilevari avatar patricevignola avatar pmbrown1055 avatar quinnradich avatar rosanevallim avatar ryanlai2 avatar serenaz avatar simplywilson avatar smk2007 avatar tiagoshibata avatar walrusmcd avatar yskim1501 avatar zhangxiang1993 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

windows-machine-learning's Issues

Runtime Error , while loading the model

Hi,

I tried following your example - to load SqueezedNet.onnx into the project. It loaded successfully.

While I am trying to load my own ONNX model, I am getting the following runtime error,

capture

Could someone please help me on this?

SSD mobilenet v1 support

I was wondering if you supported SSD Mobilenet v1 opset 10, which allows the use of nms. If not, I am receiving the following issue:

C:\Users\t\Downloads\WinMLRunner_v1.2.0.1\WinMLRunner_v1.2.0.1\x64>WinMLRunner.exe -model ssd_mobilenet_v1_coco_2017_11_17\output_model.onnx -iterations 200
Loading model (path = ssd_mobilenet_v1_coco_2017_11_17\output_model.onnx)...
Load Model: ssd_mobilenet_v1_coco_2017_11_17\output_model.onnx [FAILED]
Nodes in a graph must be topologically sorted, however input 'Postprocessor/BatchMultiClassNonMaxSuppression/map/while/stack/2:0' of node:
input: "Postprocessor/BatchMultiClassNonMaxSuppression/map/while/stack/2:0" output: "Postprocessor/BatchMultiClassNonMaxSuppression/map/while/stack_Unsqueeze__2306:0" name: "Postprocessor/BatchMultiClassNonMaxSuppression/map/while/stack_Unsqueeze__2306" op_type: "Unsqueeze" attribute { name: "axes" ints: 0 type: INTS } domain: ""
is not output of any previous nodes.
Nodes in a graph must be topologically sorted, however input 'Postprocessor/BatchMultiClassNonMaxSuppression/map/while/stack/2:0' of node:
input: "Postprocessor/BatchMultiClassNonMaxSuppression/map/while/stack/2:0" output: "Postprocessor/BatchMultiClassNonMaxSuppression/map/while/stack_Unsqueeze__2306:0" name: "Postprocessor/BatchMultiClassNonMaxSuppression/map/while/stack_Unsqueeze__2306" op_type: "Unsqueeze" attribute { name: "axes" ints: 0 type: INTS } domain: ""
is not output of any previous nodes.

Any ideas on the problem?

CustomTensorization project's Windows SDK version newer than current released Insider SDK

I'm submitting a…

Bug report (I searched for similar issues and did not find one)

Current behavior

The current CustomTensorization project's SDK version is set to 10.0.18238.0, and the most recent version that I can get is 10.0.17763.0. This makes it hard to run the sample.

Expected behavior

That either the SDK be set to 10.0.17763.0 and be able to be built when copying the correct libraries, or that 10.0.18238.0 be able to be downloaded.

Minimal reproduction of the problem with instructions

Open the CustomTensorization project in Visual Studio. Go into the properites of the project and check the Windows SDK version.

Environment

Windows Build Number: Windows 10 1809
Visual Studio

  • [ x] 2017 (version:15.8.7 )
  • 2017 Preview (version: )

Error while evaluating the model which is converted from Keras to ONNX

Hello,

I have built a model in Keras and I successfully converted into ONNX. I have to load to converted ONNX model into Windows ML.

The Windows ML by-default accepts Input shape as { batch_size, channels, height, width}

But my onnx model accepts the input shape as { batch_size , height, width, channels }

Because of this while binding the model to input in Windows ML i am getting an error.
So how can i handle this in Windows ML?

Could someone please answer for this?

Thanks,
Rathna

SampleOnnxEvaluationApp and DirectX throws error for multiclass classification

Loading a custom Onnx model with 6 labels work does not work with DirectX. But loading a custom Onnx model with only one label works. I get this error:

"Unspecified error\r\n\r\nonecoreuap\windows\windowsai\engine\lotus\onnxruntime\core\framework\execution_frame.cc:456 onnxruntime::VerifyShape tensor->Shape() == parameters.tensor_shape was false. MLValue shape verification failed. Current shape:{1,1,1,1,1,1} Requested shape:{1,1}\n"

The 6 label model works fine with LearningModelDeviceKind.Default
And using a model with only one label works with LearningModelDeviceKind.DirectX

Batch_Normalization appears to cause issues

Currently I am working on a super resolution project and I am Unable to load my model using winml_prerelease version. After disabling batchnormalization it works which is strange because the mdoel works in cntk. Below I have put my error.

System.Runtime.InteropServices.COMException
HResult=0x80004005
Message=Unspecified error

Required attribute 'consumed_inputs' is missing.
Source=System.Private.CoreLib
StackTrace:
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at SuperResolutionProject_Infer.Model.<CreateFromStorageFile>d__3.MoveNext() in C:\Users\mramados\source\repos\App\SuperResolutionProject_Infer\4xmodel.cs:line 29 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult()
at SuperResolutionProject_Infer.NeuralNetworkTask.<Eval_NN>d__24.MoveNext() in \NeuralNetworkTask.xaml.cs:line 219

An error occured while converting keras model to ONNX format. Elu function problem.

Hi, I use elu function in my model and I want to convert the model (from keras tensorflow) to ONNX format in order to use it with C# windows app.

I try to load the model with winmltools using the code below:

from winmltools import convert_keras
model_onnx = convert_keras(model, target_opset=8, name="cropper")

It gave me an error:

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-8-156ad53f924e> in <module>()
      1 from winmltools import convert_keras
      2 
----> 3 model_onnx = convert_keras(model, target_opset=8, name="cropper")
      4 print(type(model_onnx))
      5 if False:

/usr/local/lib/python3.6/dist-packages/winmltools/convert/main.py in convert_keras(model, target_opset, name, initial_types, doc_string, default_batch_size, channel_first_inputs, custom_conversion_functions, custom_shape_calculators)
    151     return _convert_keras(model, name=name, target_opset=target_opset, initial_types=initial_types, doc_string=doc_string,
    152                           default_batch_size=default_batch_size, channel_first_inputs=channel_first_inputs,
--> 153                           custom_conversion_functions=custom_conversion_functions, custom_shape_calculators=custom_shape_calculators)
    154 
    155 

/usr/local/lib/python3.6/dist-packages/onnxmltools/convert/keras/convert.py in convert(model, name, default_batch_size, initial_types, doc_string, target_opset, targeted_onnx, channel_first_inputs, custom_conversion_functions, custom_shape_calculators)
     46         name = str(uuid4().hex)
     47 
---> 48     onnx_model = convert_topology(topology, name, doc_string, target_opset, targeted_onnx, channel_first_inputs)
     49     return onnx_model

/usr/local/lib/python3.6/dist-packages/onnxmltools/convert/common/_topology.py in convert_topology(topology, model_name, doc_string, target_opset, targeted_onnx, channel_first_inputs)
    719         else:
    720             # Convert the selected operator into some ONNX objects and save them into the container
--> 721             _registration.get_converter(operator.type)(scope, operator, container)
    722 
    723     # When calling ModelComponentContainer's add_initializer(...), nothing is added into the input list. However, in

/usr/local/lib/python3.6/dist-packages/onnxmltools/convert/keras/operator_converters/Conv.py in convert_keras_conv2d(scope, operator, container)
    144 def convert_keras_conv2d(scope, operator, container):
    145     is_transpose, n_dims, input_perm, output_perm, weight_perm = get_converter_config(2, False)
--> 146     convert_keras_conv_core(scope, operator, container, is_transpose, n_dims, input_perm, output_perm, weight_perm)
    147 
    148 

/usr/local/lib/python3.6/dist-packages/onnxmltools/convert/keras/operator_converters/Conv.py in convert_keras_conv_core(scope, operator, container, is_transpose, n_dims, input_perm_axes, output_perm_axes, weight_perm_axes)
    117     # The construction of convolution is done. Now, we create an activation operator to apply the activation specified
    118     # in this Keras layer.
--> 119     apply_activation_function = _activation_map[op.activation]
    120     activation_output_name = scope.get_unique_variable_name('activation_output')
    121     apply_activation_function(scope, intermediate_output_name, activation_output_name, container)

KeyError: <function elu at 0x7f48da1697b8>

I did some research and found out that ONNX format supports ELU function. Is there anything that I do wrong or is it a bug?

No suitable kernel definition found for op Add issue

Running latest WinMLRunning but getting error:

No suitable kernel definition found for op Add (node InceptionV1/InceptionV1/Conv2d_1a_7x7/BatchNorm/FusedBatchNorm)

I converted custom inference frozen Inception model to ONNX using VS or mmdnn. I'm getting similar error when writing new Win32 WinML desktop application from scratch.

https://stackoverflow.com/questions/52372456/windows-machine-learning-no-suitable-kernel-definition-found-for-op-add

OS: 17758 insider preview
SDK : 17754 insider preview
VS: 15.8.4

WinML Runner
GPU: Intel(R) UHD Graphics 620

=================================================================
Name: tf2onnx
Author: tf2onnx
Version: 9223372036854775807
Domain:
Description:
Path: test3.onnx
Support FP16: false

Input Feature Info:
Name: input:0
Feature Kind: Float

Output Feature Info:
Name: InceptionV1/Logits/Predictions/Reshape_1:0
Feature Kind: Float

=================================================================

Loading model...[SUCCESS]
Creating session [FAILED]
No suitable kernel definition found for op Add (node InceptionV1/InceptionV1/Conv2d_1a_7x7/BatchNorm/FusedBatchNorm)

=================================================================
Name: tf2onnx
Author: tf2onnx
Version: 9223372036854775807
Domain:
Description:
Path: test3.onnx
Support FP16: false

Input Feature Info:
Name: input:0
Feature Kind: Float

Output Feature Info:
Name: InceptionV1/Logits/Predictions/Reshape_1:0
Feature Kind: Float

=================================================================

Loading model...[SUCCESS]
Creating session [FAILED]
No suitable kernel definition found for op Add (node InceptionV1/InceptionV1/Conv2d_1a_7x7/BatchNorm/FusedBatchNorm)

Microsoft Visual C++ Runtime Error when loading model

I'm submitting a…

Bug report

Current behavior

in base.h it throws throw hresult_error(result, hresult_error::from_abi);

image

Expected behavior

Minimal reproduction of the problem with instructions

Just compile and run the exe with command line
.\SqueezeNetObjectDetectionCPP.exe F:\VSProjects\source\repos\Windows-Machine-Learning\SharedContent\models\SqueezeNet.onnx "图片\1.jpg" cpu

Environment

Windows Build Number: 10.0.17134

App min and target version:

OS Version (Server, IoT Core, Desktop, etc): Desktop

Graphics Driver version: CUDA9.0

DxDiag:

WinMLTools specific:
- Source training framework: (e.g. CoreML, Scikit-learn, …)
- WinMLTools version

Visual Studio

  • 2017 (version: )15.9.3
  • 2017 Preview (version: )

Details about the MNIST model training?

The demo code looks great, and I was able to run it without any problem. I am just curious, what the model is. Is it trained with a classifical ML algorithm like SVM, or is it an NN based model? What framework was it trained in?

Exception in the release x64 build

The release x64 build hit a runtime exception. The debug x64 build did not hit this exception. Ran it on Windows 10.0.17134.48. Exception occurred after writing a digit and clicking on the recognize button.

System.Runtime.InteropServices.MissingInteropDataException
HResult=0x80131500
Message=ComTypeMarshalling_MissingInteropData, System.Collections.Generic.IList<System.Single>. For more information, visit http://go.microsoft.com/fwlink/?LinkId=623485
Source=
StackTrace:

Generated class in MNIST Tutorial for Input has type TensorFloat

I'm submitting a…

Bug report (I searched for similar issues and did not find one)

Current behavior

When following this tutorial
https://docs.microsoft.com/en-us/windows/ai/get-started-uwp

When the .onnx model is added, the generated class 'Input' has a public variable 'Input3' which gets generated with a type of 'TensorFloat'

Expected behavior

The type should be 'ImageFeatureValue'. If the variable is changed to this type, the project builds and runs correctly

Minimal reproduction of the problem with instructions

Follow the instructions here:

https://docs.microsoft.com/en-us/windows/ai/get-started-uwp

Environment

Windows Build Number: 10.0.17763

App min and target version: Windows 10, version 1809; Build 17763)

OS Version (Server, IoT Core, Desktop, etc): Windows 10 Enterprise

Graphics Driver version: NVIDIA Quadro K1000M Version 2.1 NVIDIA Build_224

DxDiag:

WinMLTools specific:
- Source training framework: (e.g. CoreML, Scikit-learn, …)
- WinMLTools version

Visual Studio

  • 2017 Enterprise Version 15.9.4

Debug/x64 flavor of several samples actually builds x86

Repro steps:

  1. Clone repo
  2. Open 'SqueezeNetObjectDetection.sln' (after performing the 'WINDOWS_WINMD' workaround here)
  3. Select the Debug/x64 build config and build the solution

Expected result: it builds a Debug/x64 version of SqueezeNetObjectDetectionCPP.exe
Actual result: it builds a Debug/x86 version of SqueezeNetObjectDetectionCPP.exe

Build log:

1>pch.cpp
1>main.cpp
1>SqueezeNetObjectDetectionCPP.vcxproj -> ...\Samples\SqueezeNetObjectDetection\Desktop\cpp\Debug\SqueezeNetObjectDetectionCPP.exe
========== Build: 1 succeeded, 0 failed, 3 up-to-date, 0 skipped ==========

Dumpbin:

Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file \SqueezeNetObjectDetection\Desktop\cpp\Debug\SqueezeNetObjectDetectionCPP.exe

PE signature found

File Type: EXECUTABLE IMAGE

FILE HEADER VALUES
             14C machine (x86)
               A number of sections
        5CED9484 time date stamp Tue May 28 13:05:24 2019
               0 file pointer to symbol table
               0 number of symbols
              E0 size of optional header
             102 characteristics
                   Executable
                   32 bit word machine

Changing the following lines of SqueezeNetObjectDetection.sln:

{2BF804D4-DAA2-42BE-9F21-0E94F021EF53}.Debug|x64.ActiveCfg = Debug|Win32
{2BF804D4-DAA2-42BE-9F21-0E94F021EF53}.Debug|x64.Build.0 = Debug|Win32

to this fixes the problem:

{2BF804D4-DAA2-42BE-9F21-0E94F021EF53}.Debug|x64.ActiveCfg = Debug|x64
{2BF804D4-DAA2-42BE-9F21-0E94F021EF53}.Debug|x64.Build.0 = Debug|x64

By inspection, it looks like other projects have the same issue too.

Conversion from TensorFlow model to ONNX using winml tools

I'm submitting a…

  • I am opening this issue regarding conversion of a TensorFlow model to ONNX format, couldn't find any open issue here.

  • The example defined in this Microsoft docs page is a bit incomplete, for anyone new attempting to use this would not get the desired result.

  • I have made minor changes and made it work, it can be found here

Please correct the documentation on Microsoft docs page.

Current behavior

  • In the given example, necessary imports are missing along with some of the mandatory parameters have not been set which results in an error when converting a TensorFlow frozen model to an onnx model.

Expected behavior

On providing the path to frozen model, model output(tensor names), path to save onnx model, the example should generate a .onxx model file.

Minimal reproduction of the problem with instructions

Copy-paste the example in a jupyter notebook, provide the path to frozen model and run it.

Environment

Windows Build Number:
Not using a Windows machine. Since this is a Python example, it is expected to work on any OS provided the required dependencies are met. I have installed winmltools from this link and by fixing the above mentioned issues, I have made it work.

App min and target version:

OS Version (Server, IoT Core, Desktop, etc):

Graphics Driver version:

  • NVIDIA GeForce 940MX (Maxwell Architecture), 4GB vRAM
  • NVIDIA 410

DxDiag:

WinMLTools specific:
- Source training framework: (e.g. CoreML, Scikit-learn, …)
- WinMLTools version

Visual Studio

  • 2017 (version: )
  • 2017 Preview (version: )

Value cannot be null error on very first run

Just built the Win 10 build 1803, and VS 2017 Preview 15.7.0 Preview 2 to run this WinMLExplorer. No modification made, but upon loading a Circut Board image, getting below error.

{System.ArgumentNullException: Value cannot be null.
Parameter name: source
at System.Linq.Enumerable.Where[TSource](IEnumerable1 source, Func2 predicate)
at WinMLExplorer.ViewModels.MainViewModel.<>c__DisplayClass31_0.b__0(Object _)
at System.Threading.WinRTSynchronizationContextBase.Invoker.InvokeCore()}

image

Any suggestions or debugging I can do?

Error evaluating trained ONNX model

I'm submitting a…

Current behavior

I export a trained model from Keras that works perfectly in Keras and TF. I export to onnx 1.2.3 with opset version 7, and i run it in WinMLRunner. It keeps failing to evaluate. This is my ouput window

Runner\x86\Release>.\WinMLRunner.exe -model rec_sys.onnx
WinML Runner
GPU: Intel(R) HD Graphics 630

Loading model (path = rec_sys.onnx)
Name: saved_model
Author: OnnxMLTools
Version: 0
Domain: onnxml
Description:
Path: rec_sys.onnx
Support FP16: false

Input Feature Info:
Name: Input_user_input_0
Feature Kind: Int64

Name: Input_app_input_0
Feature Kind: Int64

Output Feature Info:
Name: prediction_Sigmoid_01
Feature Kind: Float

=================================================================

Binding (device = CPU, iteration = 1, inputBinding = CPU, inputDataType = Tensor, deviceCreationLocation = WinML)...[SUCCESS]
Evaluating (device = CPU, iteration = 1, inputBinding = CPU, inputDataType = Tensor, deviceCreationLocation = WinML)...[FAILED]
indices element out of data bounds, idx=59113455960981528 data_dim=7298

Expected behavior

The model is supposed to be successfully evaluated and output a prediction

Minimal reproduction of the problem with instructions

To reproduce, try importing a trained Keras model to WinML

Environment

Windows Build Number: 1809

App min and target version: min version: 17134
target version: 18272

OS Version (Server, IoT Core, Desktop, etc): Windows 10 RS5 Preview

WinMLTools specific:
- Source training framework: (e.g. CoreML, Scikit-learn, …): Keras with Tensorflow backend
- WinMLTools version: 1.2.0.912

Visual Studio

  • 2017 (version: )
  • [ X ] 2017 Preview (version: )

The type or namespace name 'AI' does not exist in the namespace 'Windows'

Till now/ I am using Windows 10 1803 I still have this problem.
"Severity Code Description Project File Line Suppression State
Error CS0234 The type or namespace name 'AI' does not exist in the namespace 'Windows' (are you missing an assembly reference?) MNIST_Demo C:\Users\xxxxx\Downloads\Windows-Machine-Learning-master\Windows-Machine-Learning-master\Samples\UWP\MNIST_GetStarted\src\MainPage.xaml.cs 14 Active"

C++/WinRT Example

I want to use the C++/WinRT WinML APIs for my project but I couldn't find a sample application. I tried to replicate the MNIST example myself but ran into some issues. Here is what I tried that didn't work:

using namespace winrt;
using namespace Windows::Media;
using namespace Windows::Storage;
using namespace Windows::Foundation;
using namespace Windows::Foundation::Collections;
using namespace Windows::AI::MachineLearning::Preview;
using namespace Windows::Graphics::Imaging;

int main()
{
	init_apartment();
	StorageFile modelFile = StorageFile::GetFileFromPathAsync(L"c:\\Users\\enes\\Downloads\\mnist.onnx").get();
	LearningModelPreview learningModel = LearningModelPreview::LoadModelFromStorageFileAsync(modelFile).get();
	LearningModelBindingPreview binding = LearningModelBindingPreview(learningModel);
	std::vector<double> output;
	SoftwareBitmap bitmap(BitmapPixelFormat::Rgba8, 28, 28);
	VideoFrame input = VideoFrame::CreateWithSoftwareBitmap(bitmap);
	binding.Bind(L"Input3", input);
	binding.Bind(L"Plus214_Output_0", output);
	LearningModelEvaluationResultPreview evalResult = learningModel.EvaluateAsync(binding, L"").get();
}

This code gives a compilation error at binding.Bind(L"Plus214_Output_0", output); saying it cannot convert from std::vector to IInspectable.

WinML Implementation of ONNX Permute does not function

I'm submitting a…

Bug report (I searched for similar issues and did not find one)

Current behavior

When attempting to perform a Permutation that is allowable under the ONNX guidelines, WindowsML returns a false result on CPU and outright fails to run on GPU. Specifically, permutations with only one axis swap (akin to a simple transpose) work fine, while permutations with more than one axis swap fail outright.

Expected behavior

The expected behavior would be that WinML is able to perform permutations as described in the ONNX guidelines.

Minimal reproduction of the problem with instructions

I have attached two onnx files, one titled permute_net.onnx and one titled transpose_net.onnx. Simply run each network in the WinML dashboard and observe that the transpose one runs fine on CPU and GPU, while the permute_net file "Succeeds" on cpu and fails outright on GPU. Even the success results in faulty output.

onnx_files.zip

Here is the message received on a GPU run of permute_net.onnx:
Creating session [FAILED]
Exception during initialization: onecoreuap\windows\windowsai\winml\dll\mloperatorauthorimpl.cpp(1260)\Windows.AI.MachineLearning.dll!00007FFAF52E80A4: (caller: 00007FFAF52F4EBE) Exception(3) tid(3234) 80070057 The parameter is incorrect.

I have also run these networks through the actual WinML process in both a C++ and a C# app as described on the windows webpage, with similar failing results.

Environment

Windows Build Number:17763.379

App min and target version: Universal Windows, Windows 10, Version 1809.

OS Version (Server, IoT Core, Desktop, etc): Desktop

Graphics Driver version: 419.67 on Titan V.

DxDiag:

WinMLTools specific:
- Source training framework: (e.g. CoreML, Scikit-learn, …), Torch, but the network is untrained.
- WinMLTools version, Not relevant.

Visual Studio

  • 2017 (version: )
  • 2017 Preview (version: )
  • 2019 Preview (version: 16.0.0 Preview 4.3)

C++ APIs - "The size of the buffer provided for a bound variable is invalid"

Hello,

I'm interested in using the pure C++ APIs, as described here. However, these are very poorly documented, which is making it very hard to use them. Aside from my error, it'd be very helpful if you could also provide examples for using this API without having to use C++/CX as provided by MLGEN.exe.

As of now, I've got a very simple test which works for creating a context and runtime, loading a model, and binding values. All of these return S_OK when called. However, the HRESULT returned from EvaluateModel(context) has the following error description:

The size of the buffer provided for a bound variable is invalid.

However, given the network architecture I expect to give the same size data in as out, and both are sized accordingly. Both the input and output report being TENSORs, and I've set pShape to the corresponding to the input/output shape, except replacing [-1, ...] with [1, ...] for the output . pData is bound to an appropriately sized vector, which has been resized to the exact size of both input and output (4096 floats, 16384 bytes). I set the DataSize member of the binding to 16384, as well.

This is the output from EnumerateModelInput/...Output:

Input #1
        Name: input_1:0
        Desc:
        FeatureType: 1 // Tensor
        ElemType: 1 // Float
        Dims: 4
        Shape: [ 1, 1, 64, 64, ]
Output #1
        Name: conv2d_8/Relu:0
        Desc:
        FeatureType: 1 // Tensor
        ElemType: 1 // Float
        Dims: 4
        Shape: [ -1, 64, 64, 1, ]

I sadly cannot share much more publicly, but I'll happily supply debug info or help out via e-mail.

WinMLRunner build failure

I'm submitting a Possible Bug with WinMLRunner (StaticLib)…

Static lib doesn't build, tried many SDK versions, Visual Studio 2017 and Win 10 x64 Release.
Error C2664 'winrt::array_view::array_view(winrt::array_view &&)': cannot convert argument 1 from 'const int8_t *' to 'const unsigned char *' WinMLRunnerStaticLib c:\program files (x86)\windows kits\10\include\10.0.17763.0\cppwinrt\winrt\base.h 3343

Current behavior

Expected behavior

Minimal reproduction of the problem with instructions

Environment

Windows Build Number:

App min and target version:

OS Version (Server, IoT Core, Desktop, etc):

Graphics Driver version:

DxDiag:

WinMLTools specific:
- Source training framework: (e.g. CoreML, Scikit-learn, …)
- WinMLTools version

Visual Studio

  • 2017 (version: )
  • 2017 Preview (version: )

pip install winmltools failure

I'm submitting a…

  • Bug report (I searched for similar issues and did not find one)

Current behavior

pip install winmltools

Expected behavior

WinMLTools installs cleanly

Minimal reproduction of the problem with instructions

On a fresh Win 10 install, install Python 3.7, Visual Studio 2017 with cmake extension
open VS command prompt and run "pip install winmltools"

Result: while installing the dependency package "onnx", hit the following error.

CMake Error at CMakeLists.txt:216 (message):
Protobuf compiler not found

WinMLTools install fails. Problem can also be reproed with "pip install onnx"

Environment

Windows Build Number: Windows 10, Version 1803, Build number 17134.285

OS Version (Server, IoT Core, Desktop, etc): Desktop

Visual Studio

  • 2017 (version: 15.8.3)

Running on the Mask R Cnn ONNX Model results in "Unrecognized attribute: ceil_mode"

I'm submitting a…

Bug report (I searched for similar issues and did not find one)

Current behavior

When running on the Mask RCNN model I get the following error output:
Unrecognized attribute: ceil_mode

I have tried squeezenet and works fine.

Expected behavior

Well, to get results and no error outputs.

Minimal reproduction of the problem with instructions

WinMLRunner_v1.2.0.1\x64>winmlrunner -Input C:\Other\sample.jpg -folder "D:\Users\Avrohom\Documents\Visual Studio 2017\Projects\VS Object Detection\models\mask_rcnn"

Environment

Windows Build Number: Latest

App min and target version:

Windows 10 Desktop

Graphics Driver version:

DxDiag:

WinMLTools specific:
- Mask Rcnn from the ONNX Model Zoo
- WinMLTools version WinMLRunner v1.2.0.1

Visual Studio

  • 2017 Latest

Add multiple image processing to WinMLRunner

I'm submitting a…

Feature Request

  • Add the ability to process a folder full of images to WinMLRunner in a loop or through batching. This would possibly preload images into an in memory tensor array, and push those changes through WinML to measure the throughput and validate the performance of that processing.

Current behavior

Expected behavior

Minimal reproduction of the problem with instructions

Environment

Windows Build Number:

App min and target version:

OS Version (Server, IoT Core, Desktop, etc):

Graphics Driver version:

DxDiag:

WinMLTools specific:
- Source training framework: (e.g. CoreML, Scikit-learn, …)
- WinMLTools version

Visual Studio

  • 2017 (version: )
  • 2017 Preview (version: )

squeezenet solution doesnt run

the description.inputfeatures is null resulting in an exception

List<ILearningModelVariableDescriptorPreview> inputFeatures = _model.Description.InputFeatures.ToList();

Fix SaveTensor unit tests

I'm submitting a…

  • Bug report (I searched for similar issues and did not find one)
    The current Save Tensor unit tests run, create a directory based on time, save out tensor data to a different directory a few seconds later, and incorrectly pass because open file result is never checked in the test.

Current behavior

Always reproduces for all architectures.

Expected behavior

  • Save Tensor unit tests would be passed a directory with a subdir based on the unit test name so the tests can run in parallel without overwriting each other.
  • Tests would then successfully perform the comparison and file if files are not found, or if the results are incorrect.

Minimal reproduction of the problem with instructions

Environment

Windows Build Number:

App min and target version:

OS Version (Server, IoT Core, Desktop, etc):

Graphics Driver version:

DxDiag:

WinMLTools specific:
- Source training framework: (e.g. CoreML, Scikit-learn, …)
- WinMLTools version

Visual Studio

  • 2017 (version: )
  • 2017 Preview (version: )

How is pcb-aoi.onnx generated?

Hi,
Could someone help me about the following issue?
In the example shown in https://blogs.technet.microsoft.com/machinelearning/2018/03/13/how-three-lines-of-code-and-windows-machine-learning-empower-net-developers-to-run-ai-locally-on-windows-10-devices/ , a input (PcbModelInput) and output (PcbModelOutput) class is generated using the pcb-aoi.onnx. Here, the input type is VideoFrame, and the output type is IList.
However, when I use my own alexnet.onnx file which is generated from pytorch using script such as "torch.onnx.export(model, dummy_input, "alexnet.onnx") “ . Then, the variable type within both Input and Output class is ILIST that is different from that in the example. In this case, how to read the input data which should be image as shown in the example? I guess the difference may be produced during the *.onnx file generation. How is the pcb-aoi.onnx produced? Does there have some additional operations for generating the pcb-aoi.onnx? Could someone help me about this point? Thanks.

Add Batch > 1 capability to WinMLRunner

I'm submitting a…

Feature Request

  • Add the ability to process batch size > 1. This should allow multiple images to be loaded in WinMLRunner and be batched to the hardware, to try and optimize compute throughput.

Current behavior

Expected behavior

Minimal reproduction of the problem with instructions

Environment

Windows Build Number:

App min and target version:

OS Version (Server, IoT Core, Desktop, etc):

Graphics Driver version:

DxDiag:

WinMLTools specific:
- Source training framework: (e.g. CoreML, Scikit-learn, …)
- WinMLTools version

Visual Studio

  • 2017 (version: )
  • 2017 Preview (version: )

Create Device with an Adapter Index on WinMLRunner

I'm submitting a…

  • Sample app request
  • Request that WinMLRunner be able to create a device with a passed in Adapter Index. Enable targeted debug on specific device. Not worried if the device is created in WinMLRunner or by WinML itself.

Current behavior

Expected behavior

Minimal reproduction of the problem with instructions

Environment

Windows Build Number:

App min and target version:

OS Version (Server, IoT Core, Desktop, etc):

Graphics Driver version:

DxDiag:

WinMLTools specific:
- Source training framework: (e.g. CoreML, Scikit-learn, …)
- WinMLTools version

Visual Studio

  • 2017 (version: )
  • 2017 Preview (version: )

LearningModelPreview.LoadModelFromStorageFileAsync returning null

What would cause LearningModelPreview.LoadModelFromStorageFileAsync to return null?

A valid StorageFile was passed as a parameter. No exception was thrown.

I'm using a model created with Azure Custom Vision service, generated using
OnnxMLTools 1.2.2.0129 (according to Netron).

This worked before for me on Insider builds. I'm running this on latest Visual Studio 15.8.6 on Windows 10 build 17763.1.

Errors while executing UNet-like onnx models

Bug Report for use of ONNX models with Windows-Machine-Learning Applications

(in particular an altered version of FNSCandyStyleTransfer sample)

Descriptions of current behavior can be seen below for each onnx model. In short, the purpose of my model is an image filter that gets distorted blurry images as input and should output them in "nice". 2 of 4 models aren't parsed/executed at all, 1 is executed but causes artifacts, 1 works (but doesn't fulfill the intended purpose).

I uploaded the onnx files, data and screenshots to my drive (https://drive.google.com/open?id=1nwFLhsK0YOg0xJ2olh6Y-c22Rbn66bxO)

System and Environment

errors can be reproduced with
WinMLRunner.exe (dowloaded on
‎Thursday, ‎June ‎6, ‎2019, ‏‎6:05:59 PM)

ML Environment

python 3.5
pytorch, onnx,... (see conda_env_packkages.txt)

Rendering Machine

Windows 10 Enterprise 1903 18362.145
VS 2017, SDK 10.0.18346.0

ONNX Models

(opset 9, might cause the trouble?)
Image filter models with an UNet-like architecture exported with pytorch (torch.onnx.export(), reloaded with onnx.load(), checked with onnx.checker.check_model(), see export.py)
All of them can be parsed by the Netron visualizer (https://lutzroeder.github.io/netron/)

My target device was the CPU not GPU

I prepared them to handle input according to the documentation (https://docs.microsoft.com/en-us/windows/ai/windows-ml/convert-model-winmltools)

UNet with Upsample/ Interpolate using scale_factors arg

(using https://pytorch.org/docs/stable/nn.html#upsample)
ONNX file: UNetScaleFactorsPytorchUpsample.onnx

Error Msg:

Loading model (path = .\G_model_120.onnx)...
Load Model: .\G_model_120.onnx [FAILED]
Type Error: Type 'tensor(int64)' of input parameter (63) of operator (Floor) in node () is invalid.
0000023468572A9C

UNet with Upsample/ Interpolate using fixed size

ONNX file: UNetScaleCustomUpsample.onnx

After I checked the model in the Netron visualizer and the pytorch code I wrote my own dimension scaling where I added a simple float cast / tried to hardcoded the number of spatial dimensions, just to be sure.. (see CustomUpsample.py)

But now I get

Loading model (path = .\polished.onnx)...
Load Model: .\polished.onnx [FAILED]
[ShapeInferenceError] Number of elements of input 'scales' must be same as rank of input 'X' and element type must be float.
000001CAD3A0810C

As the input dimension of my tensor and the scales factor array's length are both 4 and the types are both float I'm puzzled why this happens.

UNet with PixelShuffle

ONNX file: UNetPixelShuffle.onnx

Can be excuted, but causes weird artifacts (see PixelShuffle_Export239.PNG, expected outcome (executed in pytorch) see pixelshuffle_result.png)

UNet only with Strided Conv / ConvTransposed

ONNX file: UNetConvTrans.onnx

Works fine, but doesn't converge in the first place (see UNet_Export_finally.PNG). But it validates that my out- and input have the correct format and that it works in general.

WinML as OpenVX Extension

I have created a WinML extension for OpenVX, to use to WinML functionality from with an OpenVX graph - https://github.com/GPUOpen-ProfessionalCompute-Libraries/MIVisionX/tree/master/amd_openvx_extensions/amd_winml#amd-winml-extension

I am able to use WinML as a node and process my neural net model. I was not sure if I was doing it the most efficient way possible. I had a few problems trying to create a TensorFloat object for the model input binding, with these in mind I had a few questions. I was hoping somebody in your team could point me in the right direction.

  • Is binding.Bind( Model Input Tensor Name, input tensor) needs to be done only once, or can I change it frame to frame as I am creating a new input TensorFloat element from CreateFromIterable.
  • Is there a way I can pass GPU memory (OpenCL mem object) into the TensorFloat object if I am using the DirectXHighPerformance mode.

Thanks for your help.

need insider

Hi I wanted to see if there is a way to include the required sdk without upgrading the windows machine to windows insider ?

Add median performance summary data to printed performance summary with -perf option

I'm submitting a…

Feature Request

  • Currently the performance summary has a lot of great information. It would be good to also include the median performance times in the summary (in addition to the mean time currently displayed).

Current behavior

Expected behavior

Minimal reproduction of the problem with instructions

Environment

Windows Build Number:

App min and target version:

OS Version (Server, IoT Core, Desktop, etc):

Graphics Driver version:

DxDiag:

WinMLTools specific:
- Source training framework: (e.g. CoreML, Scikit-learn, …)
- WinMLTools version

Visual Studio

  • 2017 (version: )
  • 2017 Preview (version: )

How to downscale the pixel values in UWP App (C#) ?

Hi,

I built a UWP App based on the Squeeze Net example provided in the repository (C#) that uses a Deep Learning model (ONNX) for image classification. I have built the deep learning model in PyTorch where the pixel values of the image have been scaled down from the range [0, 255] to [0, 1] and then normalized with channel wise (RGB) standard deviation and mean. So, this model expects the pixel values other than [0, 255] range.

But in the UWP App, I'm unable to perform this downscaling of the pixel values before binding the inputs to the model. I have searched the SoftwareBitmap class but couldn't find a way to perform this downscaling operation. Any help would be very very appreciated.

I need this operation somewhere in between these lines of code.

`

            await LoadModel();

            // Trigger file picker to select an image file
            var picker = new FileOpenPicker();
            picker.ViewMode = PickerViewMode.Thumbnail;
            picker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
            picker.FileTypeFilter.Add(".jpg");
            picker.FileTypeFilter.Add(".jpeg");
            picker.FileTypeFilter.Add(".png");
            StorageFile file = await picker.PickSingleFileAsync();

            outputTextBlock.Text = $"The selected Image: {file.Name}";

            SoftwareBitmap softwareBitmap;
            using (IRandomAccessStream stream = await file.OpenAsync(FileAccessMode.Read))
            {
                // Create the decoder from the stream 
                BitmapDecoder decoder = await BitmapDecoder.CreateAsync(stream);

                PixelDataProvider random = await decoder.GetPixelDataAsync();
                // byte[] pD =  random.DetachPixelData();
                //await FileIO.WriteBytesAsync("path/file.ext", pD);
                // System.IO.File.WriteAllBytes("path/file.ext", pD);
                // byteData.Text = $"{pD}";
                

                // Get the SoftwareBitmap representation of the file in BGRA8 format
                softwareBitmap = await decoder.GetSoftwareBitmapAsync();
                softwareBitmap = SoftwareBitmap.Convert(softwareBitmap, BitmapPixelFormat.Bgra8, BitmapAlphaMode.Ignore);
            }
            
            var streamD = await file.OpenReadAsync();
            var imageSource = new BitmapImage();
            await imageSource.SetSourceAsync(streamD);

            selectedImage.Source = imageSource;

            // Display the image
            //SoftwareBitmapSource imageSource = new SoftwareBitmapSource();
            //await imageSource.SetBitmapAsync(softwareBitmap);
            //selectedImage.Source = imageSource;

            // Encapsulate the image within a VideoFrame to be bound and evaluated
            VideoFrame inputWoodImage = VideoFrame.CreateWithSoftwareBitmap(softwareBitmap);

            await EvaluateVideoFrameAsync(inputWoodImage);`

Thanks
Krishna

Errors evaluating 3D CNN model (Keras)

Hello,

I'm submitting a bug report (I searched for similar issues and did not find one).

Current behavior

I build a Keras CNN which is based on 3D operations (Conv3D, MaxPooling3D, Upsampling3D, ..) and converted it with keras2onnx.
When I run the ONNX models with the WinMLRunner an exception is raised:

onecoreuap\windows\windowsai\winml\dll\learningmodel.cpp(378)\Windows.AI.MachineLearning.dll!00007FFE4EF7956B: (caller: 00007FFE4EFFB6D9) Exception(2) tid(3364) 80070057 Falscher Parameter. 000001B1CEF4217C

Is Windows ML not capable of running such models?

I tried different model modifications, which all failed:

  • Created a channels_first and a channels_last model version: in/out=[1, 1, 64, 64, 64] and [1, 64, 64, 64, 1] respectively.
  • Used different opsets: 7, 8
  • Used different converters: onnxtools 1.3.1, keras2onnx 1.3.2, winmltools 1.3.0, WinML Dashboard 0.51.
  • Replaced a 'keras.layers.Conv3DTranspose' layer, because it raised another exception:

Binding (device = CPU, iteration = 1, inputBinding = CPU, inputDataType = Tensor, deviceCreationLocation = WinML)...[SUCCESS]
[FAILED]
Input X must be 4-dimensional. X: {1,128,16,16,16}
Evaluating (device = CPU, iteration = 1, inputBinding = CPU, inputDataType = Tensor, deviceCreationLocation = WinML)...[FAILED]

The attached model version (channels_first [1, 1, 64, 64, 64], keras2onnx 1.3.2, onnx 1.3.0, opset_version 7) runs without errors using the onnxruntime 0.3.0 python package.
unet3d.channels_first.keras2onnx.onnx in models.zip

Minimal reproduction of the problem with instructions

Run attached ONNX model in WinMLRunner, or convert attached Keras model (.h5) to an .onnx model first.

Environment

Windows Build Number: Windows 10 Version 1809 (Build 17763.437)

App min and target version:
WinMLRunner.exe Version: 1.0.1.0.190321.abf02d3

WinMLTools specific:
- Keras framework (keras 2.2.4, tensorflow 1.12.0)
- WinMLTools version 1.0.1.0

Best regards,
Volker

Class not registered?

I receive the following error after trying to run resnet50 using winML.

Loading model (path = resnet50\resnet50\model.onnx)...
Load Model: resnet50\resnet50\model.onnx [FAILED]
Class not registered
Class not registered

Systems
Processor: Intel(R) Core(TM) i5-8350U CPU @ 1.70GHz, 1896 Mhz, 4 Core(s), 8 Logical Processor(s)
OS: Microsoft Windows 10 Enterprise

Crash in AdapterSelection sample...

Possible Bug Report

I run the AdapterSelection sample, and see this in the transcript...

Index: 0, Description: NVIDIA GeForce RTX 2080 Ti
Please enter the index of the adapter you want to use...
0
Selected adapter at index 0
Loading modelfile 'C:\Users\John\Test\squeezenet1.1.onnx' on the selected device
model file loaded in 16 ticks
Loading the image...
Binding...
Running the model...

then pops up the Abort/Ignore/Retry panel

Used VS2017, SDK 17763, the model is the squeezenet model downloaded from ONNX Zoo.

Maybe its not enough for you to debug -- but what sorts of things might it be? Thanks!

Cannot create session with GPU device

I'm submitting a…

Bug report (I searched for similar issues and did not find one)

Current behavior

WinML UWP

It cannot create learning model session with GPU.
image

WinMLRunner

I also tried to use
WinMLRunner.exe -model Squeeze.onnx
And it crush as below.
image

When I try to debug it, it also got error in create learning model session with GPU.
image

Minimal reproduction of the problem with instructions

code in UWP
_device = new LearningModelDevice(LearningModelDeviceKind.DirectX);
_session_gpu = new LearningModelSession(_model, _device);

Environment

Windows Build Number:
Win 10 v1809
App min and target version:
build version 17763
OS Version (Server, IoT Core, Desktop, etc):
Desktop
Graphics Driver version:
image

image

DxDiag:

  Display Tab 1: No problems found.
    Sound Tab 1: No problems found.
    Sound Tab 2: No problems found.
      Input Tab: No problems found.

Visual Studio
2017

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.