WindowsML.Open
--------------

Loads a model for Windows Machine Learning.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [WindowsML](component_WindowsML.md) | [10.5](newinversion105.md) | ❌ No | ✅ Yes | ❌ No | ✅ Yes, on Windows | ❌ No |

MBS( "WindowsML.Open"; Path ) 

**MBS**( **"WindowsML.Open";** /\* Loads a model for Windows Machine Learning. \*/  
**$Path**) /\* The native file path to the model file.e.g. "C:\\Users\\Christian\\Desktop\\SqueezeNet.onnx" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Path | The native file path to the model file. | "C:\\Users\\Christian\\Desktop\\SqueezeNet.onnx" |

### Result

Returns reference number or error.

### Description

Loads a model for Windows Machine Learning.  
Please use an onnx file as you find them on various websites, e.g. start here:  
<https://docs.microsoft.com/en-us/windows/ai/windows-ml/get-onnx-model>  
  
Will return an error about unregistered class if called on older Windows versions before 10.  
  
This function requires a native path. Use [Path.FileMakerPathToNativePath](PathFileMakerPathToNativePath.md) to convert a FileMaker path to a native path if required. If you like to have the user choose the path, you can use [FileDialog](component_FileDialog.md) functions.  
For Server be aware that server has limited permissions and may not be able to access all files on a computer.  
### Examples

Load a model

 Set Variable \[ $model ; Value: MBS ("WindowsML.Open"; "C:\\Users\\Christian\\Desktop\\SqueezeNet.onnx") \]  
<small>  
Example result: 73001</small>Load a model and show description:

 # Load Model in file WindowsML   
Go to Layout \[ “WindowsML” (WindowsML) ; Animation: None \]  
\#   
Set Variable \[ $WinMLRef ; Value: MBS ( "WindowsML.Open"; WindowsML::Model File Path ) \]   
If \[ MBS ("ISError") \]   
 Show Custom Dialog \[ "Failed to load model" ; $WinMLRef \]   
Else  
 Set Variable \[ $$WinMLRef ; Value: $WinMLRef \]   
 Set Field \[ WindowsML::Model Description ; MBS ("[JSON.Colorize](JSONColorize.md)"; MBS ( "[WindowsML.Description](WindowsMLDescription.md)"; $$WinMLRef )) \]   
End If  
### See also

- [IsError](IsError.md)
- [JSON.Colorize](JSONColorize.md)
- [Path.FileMakerPathToNativePath](PathFileMakerPathToNativePath.md)
- [WindowsML.Clear](WindowsMLClear.md)
- [WindowsML.Description](WindowsMLDescription.md)
- [WindowsML.List](WindowsMLList.md)

### Example Databases

- [Win Only/WindowsML](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Win%20Only/WindowsML.shtml#3ScriptAnchor_)

### Blog Entries

- [New in MBS FileMaker Plugin 10.5](https://www.mbsplugins.de/archive/2020-11-23/New_in_MBS_FileMaker_Plugin_10/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 6/2020, Seite 27](https://filemaker-magazin.de/neuigkeit/4118-Appetithappen-FMM_202006)

This function checks for a license.

Created 26th September 2020 , last changed 27th September 2020

  
[WindowsML.List](WindowsMLList.md) - [WindowsML.Release](WindowsMLRelease.md)

[HTML Version](WindowsMLOpen.shtml)