dotnet / machinelearning-modelbuilder

Simple UI tool to build custom machine learning models.
Creative Commons Attribution 4.0 International
264 stars 56 forks source link

Cannot run sample program #1345

Closed adamantinum closed 3 years ago

adamantinum commented 3 years ago

System Information (please complete the following information):

Describe the bug

To Reproduce Steps to reproduce the behavior:

  1. cd consumeModelApp
  2. dotnet add reference "../SampleClassification/SampleClassification.Model/SampleClassification.Model.csproj"
  3. Edit Program.cs as explained
  4. The error occurs when the command dotnet run is used
  5. See error: Unhandled exception. System.IO.FileNotFoundException: Could not find file 'C:\Users\Alessandro\Desktop\myMLApp\consumeModelApp\MLModel.zip'. File name: 'C:\Users\Alessandro\Desktop\myMLApp\consumeModelApp\MLModel.zip' at System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle) at System.IO.FileStream.CreateFileOpenHandle(FileMode mode, FileShare share, FileOptions options) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) at System.IO.File.OpenRead(String path) at Microsoft.ML.ModelOperationsCatalog.Load(String filePath, DataViewSchema& inputSchema) at SampleClassification.Model.ConsumeModel.CreatePredictionEngine() in C:\Users\Alessandro\Desktop\myMLApp\SampleClassification\SampleClassification.Model\ConsumeModel.cs:line 37 at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode) at System.Lazy1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor) at System.Lazy1.CreateValue() at System.Lazy1.get_Value() at SampleClassification.Model.ConsumeModel.Predict(ModelInput input) in C:\Users\Alessandro\Desktop\myMLApp\SampleClassification\SampleClassification.Model\ConsumeModel.cs:line 27 at consumeModelApp.Program.Main(String[] args) in C:\Users\Alessandro\Desktop\myMLApp\consumeModelApp\Program.cs:line 18

Expected behavior Program should run.

Thank you in advance.

beccamc commented 3 years ago

@adamantinum Sorry for the delay here. Did you copy the generated MLModel.zip file from the SampleClassification.Model folder to the consumeModelApp folder?

adamantinum commented 3 years ago

Thank you for your reply. Yes, I was able to run the program copying MLModel.zip, but there isn't written in the tutorial, so I suppose it should work without doing it, also because SampleClassification.Model.csproj is referenced in the consumeModelApp project file.

beccamc commented 3 years ago

Glad you got it working @adamantinum! I want to make sure our docs are clear. We do have a note about copying the zip, but it seems it isn't noticeable.

image

Sorry, I'm not trying to call you out! I want to hear if you have feedback on how we make this more clear and understandable.

adamantinum commented 3 years ago

Oh my fault, it has escaped me. Sorry and thank you for your patience.

beccamc commented 3 years ago

No problem! Please let us know if you run into any more issues