© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
110 replies
Eris

✅ Can't use Machine Learning Model

Heyo! So I wanted to try out using an AI model to sort some pictures into one of two categories, the app I'm trying to use it in is a Console App in .NET Framework 4.7.2 targeted for x64, I've added a Machine Learning Model (called Stone_Diff), trained it and it works great, but I can't figure out how to use it. I copied the sample code the setup gave me, but it comes up as "The type or namespace name 'Stone_Diff' could not be found" and "The name 'Stone_Diff' does not exist in the current context". Here's the code I'm using:
//Load sample data
var imageBytes = File.ReadAllBytes(@"path-to-file\0.png");
Stone_Diff.ModelInput sampleData = new Stone_Diff.ModelInput()
{
    ImageSource = imageBytes,
};

//Load model and predict output
var result = Stone_Diff.Predict(sampleData);
//Load sample data
var imageBytes = File.ReadAllBytes(@"path-to-file\0.png");
Stone_Diff.ModelInput sampleData = new Stone_Diff.ModelInput()
{
    ImageSource = imageBytes,
};

//Load model and predict output
var result = Stone_Diff.Predict(sampleData);

Why's it erroring out, do I need to manually add some references or something? If so, I couldn't find how to do it with the normal Add Referenced menu, nor could I find a way to get
using Stone_Diff;
using Stone_Diff;
to work. Thank you for reading!
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements
Next page

Similar Threads

❔ What is the purpose of `ModelBindingContext.Model`, `ModelName`, and `ModelBinderAttribute.Name`?
C#CC# / help
3y ago
Machine Learning .NET
C#CC# / help
13mo ago
❔ Machine Learning recommendations
C#CC# / help
3y ago
Machine learning in .net
C#CC# / help
2y ago