ITransformer BuildAndTrainModel(IDataView trainingDataView, ImageClassificationTrainer.Options classifierOptions)
{
WriteLine($"Build and train model...");
var trainingPipeline = mlContext.MulticlassClassification.Trainers.ImageClassification(classifierOptions)
.Append(mlContext.Transforms.Conversion.MapKeyToValue("PredictedLabel"));
return trainingPipeline.Fit(trainingDataView); <<- Error
}
hits a runtime error:
System.InvalidOperationException
HResult=0x80131509
Message=Error downloading resource from 'https://aka.ms/mlnet-resources/meta/resnet_v2_101_299.meta': DownloadFailed with exception One or more errors occurred. (Object synchronization method was called from an unsynchronized block of code.)\nDownloadFailed with exception One or more errors occurred. (The wait completed due to an abandoned mutex.)\nDownloadFailed with exception One or more errors occurred. (Object synchronization method was called from an unsynchronized block of code.)\nDownloadFailed with exception One or more errors occurred. (The wait completed due to an abandoned mutex.)\nDownloadFailed with exception One or more errors occurred. (The wait completed due to an abandoned mutex.)\n
Meta file could not be downloaded! Please copy the model file 'resnet_v2_101_299.meta' from 'meta\resnet_v2_101_299.meta' to 'C:\Users\me\AppData\Local\Temp\MLNET'.
Source=Microsoft.ML.TensorFlow
StackTrace:
at Microsoft.ML.TensorFlow.TensorFlowUtils.DownloadIfNeeded(IHostEnvironment env, String url, String dir, String fileName, Int32 timeout)
at Microsoft.ML.Vision.ImageClassificationTrainer.LoadTensorFlowSessionFromMetaGraph(IHostEnvironment env, Architecture arch)
at Microsoft.ML.Vision.ImageClassificationTrainer.InitializeTrainingGraph(IDataView input)
at Microsoft.ML.Vision.ImageClassificationTrainer.TrainModelCore(TrainContext trainContext)
at Microsoft.ML.Trainers.TrainerEstimatorBase`2.TrainTransformer(IDataView trainSet, IDataView validationSet, IPredictor initPredictor)
at Microsoft.ML.Trainers.TrainerEstimatorBase`2.Fit(IDataView input)
at Microsoft.ML.Data.EstimatorChain`1.Fit(IDataView input)
at Program.<<Main>$>g__BuildAndTrainModel|0_2(IDataView trainingDataView, Options classifierOptions, <>c__DisplayClass0_0& ) in C:\Projects\ML.Net\DeepLearning_ImageClassification_Binary\src\Program.cs:line 83
at Program.<Main>$(String[] args) in C:\Projects\ML.Net\DeepLearning_ImageClassification_Binary\src\Program.cs:line 21
To Reproduce
Steps to reproduce the behavior:
Go to '...'
Click on '....'
Scroll down to '....'
See error
Expected behavior
Runs successfully
Screenshots, Code, Sample Projects
If applicable, add screenshots, code snippets, or sample projects to help explain your problem.
Additional context
Add any other context about the problem here.
System Information (please complete the following information):
Describe the bug Following this tutorial https://learn.microsoft.com/en-us/dotnet/machine-learning/tutorials/image-classification-api-transfer-learning, the following code snippet:
hits a runtime error:
To Reproduce Steps to reproduce the behavior:
Expected behavior Runs successfully
Screenshots, Code, Sample Projects If applicable, add screenshots, code snippets, or sample projects to help explain your problem.
Additional context Add any other context about the problem here.