Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Is this a bug, or is Microsoft ML incompatible with Windows Forms #733
Comments
|
Update: Debugging more deeply: The error occurs in the line within ConsumeModel class:
|
|
I found a similar issue in Microsoft.ML NuGet package doesn't work with packages.config #93. Following this thread, I had a look at the packaging.config file. There I found that all included packages use .NET Framework 4.6.1 as target. On my computer version 4.8.3752.0 is installed. Could this be the reason? Should I change the target framework to the actual version? |
|
It is compatible, you just need to select/run on x64. If you migrate the WinForms app to .NET Core 3.0, you won't have this issue. :) |
|
Feel free to close this issue if working for you, ok? |
|
Aren’t the WinForms samples I mentioned above not working for you? |
|
I will try, but it is unlikely that it is a programming error of mine. The error occurs in code produced automatically by Microsoft Visual Studio! In fact, I opened a minimal Forms window and added "Machine learning" from the VS menu. But I will try the examples. I think it depends upon the fact which ML Trainer is used etc. |
|
The Taxi Fare example I tried out long ago, since it is part of the basic tutorials from Microsoft. Of course, it works. But it is a console application, not windows forms. Summarizing once more my problem:
|
|
Hi Issuer,
plz check it for inspect more details:
https://docs.microsoft.com/en-us/dotnet/machine-learning/how-does-mldotnet-work#mlnet-architecture
…On Sun, Nov 3, 2019, 16:58 FranzBl ***@***.***> wrote:
The Taxi Fare example I tried out long ago, since it is part of the basic
tutorials from Microsoft. Of course, it works. But it is a console
application, not windows forms.
The Spike Detection example seems to be damaged in the GitHub repository
because it is impossible to compile within Visual Studio. First of all this
project doesn't allow to install nuget packages, for there is an "invalid
version number" whose value is "". Additionally this project seems to be
incompatible with .NET version 2.2 and higher since it forces to downgrade
to .NET 2.1
I will not invest much work in this. Even if this sample compiles and
works, that doesn't prove anything. Machine Learning is such a wide field
with so many objects, methods, parameters, pre-trained models etc., i. e.
so many boundary conditions that the fact that one program is running
doesn't tell us anything about another program.
Summarizing once more my problem:
1. I opened a new VS project with a windows forms app.
2. I used ML.NET model builder tool to implement machine learning to
the project (in fact I could implement the model builder myself, but it is
a nice feature that the ML.NET model builder pre-trains given data and
tries to detect which trainer would be the best). In my case the model
builder selected Ols as a favourite. But I tried other trainers too,
resulting in the same errors.
3. Usually ML.NET model builder adds two new projects to the project
folder: a console app (containing the model builder for additional
training) and a second project that contains the class definitions for the
dataview and a ConsumeModel method for predictions.
4. If I enter the using directive to the Model project in the forms
windows app, first of all the project can't compile without an explicit
using Microsoft.ML directive in the Forms class. This is strange because
this class doesn't call any methods from Microsoft.ML but only the
ConsumeModel method where all necessary packages are referenced correctly.
5. After adding Microsoft.ML to the package list of the forms app, the
program builds without errors. But if I want to predict a new value using
the ConsumeModel method, further packages are demanded during runtime.
First the program dies because Microsoft.ML.Mkl.Components package is
missing. If I install this, next run of the program dies because
"CpuMathNative.dll" is missing, and this dll can't be found anywhere.
6. If I call the ConsumeModel method via the console app instead of
the windows forms, everything works fine,
7. On the web there are suggestions that to resolve this one should
install Microsoft Visual C++ Redistributable 2017. On my computer version
2015-2019 is installed, including 2017.
8. My test program doesn't contain any handwritten code of mine but
was completely built by Microsoft VS. So, even if the user program would be
erraneous (I don't think it is), it would be a bug.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#733?email_source=notifications&email_token=AEYAMLYSNC54CA76IBAAMM3QR2OC3A5CNFSM4JHH4AV2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEC5OY5A#issuecomment-549121140>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEYAML6DI6G2DYOXNOC3MDLQR2OC3ANCNFSM4JHH4AVQ>
.
|
|
The Winforms samples using ML.NET at this repo work properly. You can see some screenshots below: If this issue is not related to the samples here but related to MODEL BUILDER, please, open an issue here: https://github.com/dotnet/machinelearning-modelbuilder/issues Thanks, |




Hello,
trying to integrate machine learnig into a Windows Forms app (even a very simple one that may only predict next value) is not successful. As soon as the ML modules are invoked, an error is thrown:
Details of the error message:
System.DllNotFoundException
HResult=0x80131524
Nachricht = Die DLL "CpuMathNative": Das angegebene Modul wurde nicht gefunden. (Ausnahme von HRESULT: 0x8007007E) kann nicht geladen werden.
Quelle =
Stapelüberwachung:
<Die Ausnahmestapelüberwachung kann nicht ausgewertet werden.>
Obviously, a DLL named CpuMathNative is missing. Does it belong to original Windows code or to .NET Framework (Version???)
Error message 0x8007007E of course has a little strong flavour :-( - Windows Update Error or damaged component store etc.
Therefore I did the usual process:
Can anybody help? Is there an incompatibility between Microsoft ML and .NET framework (GUI)? For first test, I implemented ML using the model generator within VS.
The test program only tries to predict a new value for the trained model. Here's the code of the ConsumeModel class:
// This file was auto-generated by ML.NET Model Builder.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.ML;
using ModelTrainerML.Model;
namespace ModelTrainerML.Model
{
public class ConsumeModel
{
// For more info on consuming ML.NET models, visit https://aka.ms/model-builder-consume
// Method for consuming model in your app
public static ModelOutput Predict(ModelInput input)
{
}
If I call the predict method from the ConsoleApp, everything works fine...
The text was updated successfully, but these errors were encountered: