dotnet / machinelearning

ML.NET is an open source and cross-platform machine learning framework for .NET.
https://dot.net/ml
MIT License
9.03k stars 1.88k forks source link

ImageClassificationTrainer can't load model #5052

Closed luislhg closed 4 years ago

luislhg commented 4 years ago

System information

Issue

Steps: Create a project. Add a Machine Learning through solution explorer, then in the ML.NET Model Builder:

  1. Scenario -> Image Classification
  2. Data -> A folder with around 8.000 images (.png) separated in 8 folders/categories.
  3. Train -> Start Training

It will result in a popup (image attached) saying "Model Builder Error". Model Builder Error

> Output/log from Machine Learning output:
> |     Trainer                              MicroAccuracy  MacroAccuracy  Duration #Iteration                     |
> [Source=ImageClassificationTrainer; ImageClassificationTrainer, Kind=Trace] Channel started
> [Source=ImageClassificationTrainer; ImageClassificationTrainer, Kind=Trace] Channel started
> [Source=ImageClassificationTrainer; Ensuring meta files are present., Kind=Trace] Channel started
> [Source=ImageClassificationTrainer; Ensuring meta files are present., Kind=Trace] Channel finished. Elapsed 00:00:00.0003974.
> [Source=ImageClassificationTrainer; Ensuring meta files are present., Kind=Trace] Channel disposed
> [Source=AutoML, Kind=Error] Pipeline crashed: xf=ValueToKeyMapping{ col=Label:Label} xf=RawByteImageLoading{ col=ImageSource_featurized:ImageSource imageFolder=} xf=ColumnCopying{ col=Features:ImageSource_featurized} tr=ImageClassification{} xf=KeyToValueMapping{ col=PredictedLabel:PredictedLabel} cache=- . Exception: System.FormatException: Tensorflow exception triggered while loading model. ---> System.DllNotFoundException: Não é possível carregar a DLL 'tensorflow': Uma rotina de inicialização da biblioteca de vínculo dinâmico (DLL) falhou. (Exceção de HRESULT: 0x8007045A)
>    em Tensorflow.c_api.TF_NewGraph()
>    em Tensorflow.Graph..ctor()
>    em Microsoft.ML.TensorFlow.TensorFlowUtils.LoadMetaGraph(String path)
>    em Microsoft.ML.TensorFlow.TensorFlowUtils.LoadTFSessionByModelFilePath(IExceptionContext ectx, String modelFile, Boolean metaGraph)
>    --- Fim do rastreamento de pilha de exceções internas ---
>    em Microsoft.ML.TensorFlow.TensorFlowUtils.LoadTFSessionByModelFilePath(IExceptionContext ectx, String modelFile, Boolean metaGraph)
>    em Microsoft.ML.Vision.ImageClassificationTrainer.LoadTensorFlowSessionFromMetaGraph(IHostEnvironment env, Architecture arch)
>    em Microsoft.ML.Vision.ImageClassificationTrainer.InitializeTrainingGraph(IDataView input)
>    em Microsoft.ML.Vision.ImageClassificationTrainer.TrainModelCore(TrainContext trainContext)
>    em Microsoft.ML.Trainers.TrainerEstimatorBase`2.TrainTransformer(IDataView trainSet, IDataView validationSet, IPredictor initPredictor)
>    em Microsoft.ML.Data.EstimatorChain`1.Fit(IDataView input)
>    em Microsoft.ML.Data.EstimatorChain`1.Fit(IDataView input)
>    em Microsoft.ML.AutoML.RunnerUtil.TrainAndScorePipeline[TMetrics](MLContext context, SuggestedPipeline pipeline, IDataView trainData, IDataView validData, String labelColumn, IMetricsAgent`1 metricsAgent, ITransformer preprocessorTransform, FileInfo modelFileInfo, DataViewSchema modelInputSchema, IChannel logger)
> [Source=ImageClassificationTrainer; ImageClassificationTrainer, Kind=Trace] Channel started
> [Source=ImageClassificationTrainer; Ensuring meta files are present., Kind=Trace] Channel started
> [Source=ImageClassificationTrainer; Ensuring meta files are present., Kind=Trace] Channel finished. Elapsed 00:00:00.0004556.
> [Source=ImageClassificationTrainer; Ensuring meta files are present., Kind=Trace] Channel disposed
> [Source=AutoML, Kind=Error] Pipeline crashed: xf=ValueToKeyMapping{ col=Label:Label} xf=RawByteImageLoading{ col=ImageSource_featurized:ImageSource imageFolder=} xf=ColumnCopying{ col=Features:ImageSource_featurized} tr=ImageClassification{} xf=KeyToValueMapping{ col=PredictedLabel:PredictedLabel} cache=- . Exception: System.FormatException: Tensorflow exception triggered while loading model. ---> System.DllNotFoundException: Não é possível carregar a DLL 'tensorflow': Uma rotina de inicialização da biblioteca de vínculo dinâmico (DLL) falhou. (Exceção de HRESULT: 0x8007045A)
>    em Tensorflow.c_api.TF_NewGraph()
>    em Tensorflow.Graph..ctor()
>    em Microsoft.ML.TensorFlow.TensorFlowUtils.LoadMetaGraph(String path)
>    em Microsoft.ML.TensorFlow.TensorFlowUtils.LoadTFSessionByModelFilePath(IExceptionContext ectx, String modelFile, Boolean metaGraph)
>    --- Fim do rastreamento de pilha de exceções internas ---
>    em Microsoft.ML.TensorFlow.TensorFlowUtils.LoadTFSessionByModelFilePath(IExceptionContext ectx, String modelFile, Boolean metaGraph)
>    em Microsoft.ML.Vision.ImageClassificationTrainer.LoadTensorFlowSessionFromMetaGraph(IHostEnvironment env, Architecture arch)
>    em Microsoft.ML.Vision.ImageClassificationTrainer.InitializeTrainingGraph(IDataView input)
>    em Microsoft.ML.Vision.ImageClassificationTrainer.TrainModelCore(TrainContext trainContext)
>    em Microsoft.ML.Trainers.TrainerEstimatorBase`2.TrainTransformer(IDataView trainSet, IDataView validationSet, IPredictor initPredictor)
>    em Microsoft.ML.Data.EstimatorChain`1.Fit(IDataView input)
>    em Microsoft.ML.Data.EstimatorChain`1.Fit(IDataView input)
>    em Microsoft.ML.AutoML.RunnerUtil.TrainAndScorePipeline[TMetrics](MLContext context, SuggestedPipeline pipeline, IDataView trainData, IDataView validData, String labelColumn, IMetricsAgent`1 metricsAgent, ITransformer preprocessorTransform, FileInfo modelFileInfo, DataViewSchema modelInputSchema, IChannel logger)
> [Source=ImageClassificationTrainer; ImageClassificationTrainer, Kind=Trace] Channel started
> [Source=ImageClassificationTrainer; Ensuring meta files are present., Kind=Trace] Channel started
> [Source=ImageClassificationTrainer; Ensuring meta files are present., Kind=Trace] Channel finished. Elapsed 00:00:00.0003859.
> [Source=ImageClassificationTrainer; Ensuring meta files are present., Kind=Trace] Channel disposed
> [Source=AutoML, Kind=Error] Pipeline crashed: xf=ValueToKeyMapping{ col=Label:Label} xf=RawByteImageLoading{ col=ImageSource_featurized:ImageSource imageFolder=} xf=ColumnCopying{ col=Features:ImageSource_featurized} tr=ImageClassification{} xf=KeyToValueMapping{ col=PredictedLabel:PredictedLabel} cache=- . Exception: System.FormatException: Tensorflow exception triggered while loading model. ---> System.DllNotFoundException: Não é possível carregar a DLL 'tensorflow': Uma rotina de inicialização da biblioteca de vínculo dinâmico (DLL) falhou. (Exceção de HRESULT: 0x8007045A)
>    em Tensorflow.c_api.TF_NewGraph()
>    em Tensorflow.Graph..ctor()
>    em Microsoft.ML.TensorFlow.TensorFlowUtils.LoadMetaGraph(String path)
>    em Microsoft.ML.TensorFlow.TensorFlowUtils.LoadTFSessionByModelFilePath(IExceptionContext ectx, String modelFile, Boolean metaGraph)
>    --- Fim do rastreamento de pilha de exceções internas ---
>    em Microsoft.ML.TensorFlow.TensorFlowUtils.LoadTFSessionByModelFilePath(IExceptionContext ectx, String modelFile, Boolean metaGraph)
>    em Microsoft.ML.Vision.ImageClassificationTrainer.LoadTensorFlowSessionFromMetaGraph(IHostEnvironment env, Architecture arch)
>    em Microsoft.ML.Vision.ImageClassificationTrainer.InitializeTrainingGraph(IDataView input)
>    em Microsoft.ML.Vision.ImageClassificationTrainer.TrainModelCore(TrainContext trainContext)
>    em Microsoft.ML.Trainers.TrainerEstimatorBase`2.TrainTransformer(IDataView trainSet, IDataView validationSet, IPredictor initPredictor)
>    em Microsoft.ML.Data.EstimatorChain`1.Fit(IDataView input)
>    em Microsoft.ML.Data.EstimatorChain`1.Fit(IDataView input)
>    em Microsoft.ML.AutoML.RunnerUtil.TrainAndScorePipeline[TMetrics](MLContext context, SuggestedPipeline pipeline, IDataView trainData, IDataView validData, String labelColumn, IMetricsAgent`1 metricsAgent, ITransformer preprocessorTransform, FileInfo modelFileInfo, DataViewSchema modelInputSchema, IChannel logger)
> [Source=ImageClassificationTrainer; ImageClassificationTrainer, Kind=Trace] Channel started
> [Source=ImageClassificationTrainer; Ensuring meta files are present., Kind=Trace] Channel started
> [Source=ImageClassificationTrainer; Ensuring meta files are present., Kind=Trace] Channel finished. Elapsed 00:00:00.0003999.
> [Source=ImageClassificationTrainer; Ensuring meta files are present., Kind=Trace] Channel disposed
> [Source=AutoML, Kind=Error] Pipeline crashed: xf=ValueToKeyMapping{ col=Label:Label} xf=RawByteImageLoading{ col=ImageSource_featurized:ImageSource imageFolder=} xf=ColumnCopying{ col=Features:ImageSource_featurized} tr=ImageClassification{} xf=KeyToValueMapping{ col=PredictedLabel:PredictedLabel} cache=- . Exception: System.FormatException: Tensorflow exception triggered while loading model. ---> System.DllNotFoundException: Não é possível carregar a DLL 'tensorflow': Uma rotina de inicialização da biblioteca de vínculo dinâmico (DLL) falhou. (Exceção de HRESULT: 0x8007045A)
>    em Tensorflow.c_api.TF_NewGraph()
>    em Tensorflow.Graph..ctor()
>    em Microsoft.ML.TensorFlow.TensorFlowUtils.LoadMetaGraph(String path)
>    em Microsoft.ML.TensorFlow.TensorFlowUtils.LoadTFSessionByModelFilePath(IExceptionContext ectx, String modelFile, Boolean metaGraph)
>    --- Fim do rastreamento de pilha de exceções internas ---
>    em Microsoft.ML.TensorFlow.TensorFlowUtils.LoadTFSessionByModelFilePath(IExceptionContext ectx, String modelFile, Boolean metaGraph)
>    em Microsoft.ML.Vision.ImageClassificationTrainer.LoadTensorFlowSessionFromMetaGraph(IHostEnvironment env, Architecture arch)
>    em Microsoft.ML.Vision.ImageClassificationTrainer.InitializeTrainingGraph(IDataView input)
>    em Microsoft.ML.Vision.ImageClassificationTrainer.TrainModelCore(TrainContext trainContext)
>    em Microsoft.ML.Trainers.TrainerEstimatorBase`2.TrainTransformer(IDataView trainSet, IDataView validationSet, IPredictor initPredictor)
>    em Microsoft.ML.Data.EstimatorChain`1.Fit(IDataView input)
>    em Microsoft.ML.Data.EstimatorChain`1.Fit(IDataView input)
>    em Microsoft.ML.AutoML.RunnerUtil.TrainAndScorePipeline[TMetrics](MLContext context, SuggestedPipeline pipeline, IDataView trainData, IDataView validData, String labelColumn, IMetricsAgent`1 metricsAgent, ITransformer preprocessorTransform, FileInfo modelFileInfo, DataViewSchema modelInputSchema, IChannel logger)
> [Source=ImageClassificationTrainer; ImageClassificationTrainer, Kind=Trace] Channel started
> [Source=ImageClassificationTrainer; Ensuring meta files are present., Kind=Trace] Channel started
> [Source=ImageClassificationTrainer; Ensuring meta files are present., Kind=Trace] Channel finished. Elapsed 00:00:00.0003329.
> [Source=ImageClassificationTrainer; Ensuring meta files are present., Kind=Trace] Channel disposed
> [Source=AutoML, Kind=Error] Pipeline crashed: xf=ValueToKeyMapping{ col=Label:Label} xf=RawByteImageLoading{ col=ImageSource_featurized:ImageSource imageFolder=} xf=ColumnCopying{ col=Features:ImageSource_featurized} tr=ImageClassification{} xf=KeyToValueMapping{ col=PredictedLabel:PredictedLabel} cache=- . Exception: System.FormatException: Tensorflow exception triggered while loading model. ---> System.DllNotFoundException: Não é possível carregar a DLL 'tensorflow': Uma rotina de inicialização da biblioteca de vínculo dinâmico (DLL) falhou. (Exceção de HRESULT: 0x8007045A)
>    em Tensorflow.c_api.TF_NewGraph()
>    em Tensorflow.Graph..ctor()
>    em Microsoft.ML.TensorFlow.TensorFlowUtils.LoadMetaGraph(String path)
>    em Microsoft.ML.TensorFlow.TensorFlowUtils.LoadTFSessionByModelFilePath(IExceptionContext ectx, String modelFile, Boolean metaGraph)
>    --- Fim do rastreamento de pilha de exceções internas ---
>    em Microsoft.ML.TensorFlow.TensorFlowUtils.LoadTFSessionByModelFilePath(IExceptionContext ectx, String modelFile, Boolean metaGraph)
>    em Microsoft.ML.Vision.ImageClassificationTrainer.LoadTensorFlowSessionFromMetaGraph(IHostEnvironment env, Architecture arch)
>    em Microsoft.ML.Vision.ImageClassificationTrainer.InitializeTrainingGraph(IDataView input)
>    em Microsoft.ML.Vision.ImageClassificationTrainer.TrainModelCore(TrainContext trainContext)
>    em Microsoft.ML.Trainers.TrainerEstimatorBase`2.TrainTransformer(IDataView trainSet, IDataView validationSet, IPredictor initPredictor)
>    em Microsoft.ML.Data.EstimatorChain`1.Fit(IDataView input)
>    em Microsoft.ML.Data.EstimatorChain`1.Fit(IDataView input)
>    em Microsoft.ML.AutoML.RunnerUtil.TrainAndScorePipeline[TMetrics](MLContext context, SuggestedPipeline pipeline, IDataView trainData, IDataView validData, String labelColumn, IMetricsAgent`1 metricsAgent, ITransformer preprocessorTransform, FileInfo modelFileInfo, DataViewSchema modelInputSchema, IChannel logger)
> [Source=ImageClassificationTrainer; ImageClassificationTrainer, Kind=Trace] Channel started
> [Source=ImageClassificationTrainer; Ensuring meta files are present., Kind=Trace] Channel started
> [Source=ImageClassificationTrainer; Ensuring meta files are present., Kind=Trace] Channel finished. Elapsed 00:00:00.0003310.
> [Source=ImageClassificationTrainer; Ensuring meta files are present., Kind=Trace] Channel disposed
> [Source=AutoML, Kind=Error] Pipeline crashed: xf=ValueToKeyMapping{ col=Label:Label} xf=RawByteImageLoading{ col=ImageSource_featurized:ImageSource imageFolder=} xf=ColumnCopying{ col=Features:ImageSource_featurized} tr=ImageClassification{} xf=KeyToValueMapping{ col=PredictedLabel:PredictedLabel} cache=- . Exception: System.FormatException: Tensorflow exception triggered while loading model. ---> System.DllNotFoundException: Não é possível carregar a DLL 'tensorflow': Uma rotina de inicialização da biblioteca de vínculo dinâmico (DLL) falhou. (Exceção de HRESULT: 0x8007045A)
>    em Tensorflow.c_api.TF_NewGraph()
>    em Tensorflow.Graph..ctor()
>    em Microsoft.ML.TensorFlow.TensorFlowUtils.LoadMetaGraph(String path)
>    em Microsoft.ML.TensorFlow.TensorFlowUtils.LoadTFSessionByModelFilePath(IExceptionContext ectx, String modelFile, Boolean metaGraph)
>    --- Fim do rastreamento de pilha de exceções internas ---
>    em Microsoft.ML.TensorFlow.TensorFlowUtils.LoadTFSessionByModelFilePath(IExceptionContext ectx, String modelFile, Boolean metaGraph)
>    em Microsoft.ML.Vision.ImageClassificationTrainer.LoadTensorFlowSessionFromMetaGraph(IHostEnvironment env, Architecture arch)
>    em Microsoft.ML.Vision.ImageClassificationTrainer.InitializeTrainingGraph(IDataView input)
>    em Microsoft.ML.Vision.ImageClassificationTrainer.TrainModelCore(TrainContext trainContext)
>    em Microsoft.ML.Trainers.TrainerEstimatorBase`2.TrainTransformer(IDataView trainSet, IDataView validationSet, IPredictor initPredictor)
>    em Microsoft.ML.Data.EstimatorChain`1.Fit(IDataView input)
>    em Microsoft.ML.Data.EstimatorChain`1.Fit(IDataView input)
>    em Microsoft.ML.AutoML.RunnerUtil.TrainAndScorePipeline[TMetrics](MLContext context, SuggestedPipeline pipeline, IDataView trainData, IDataView validData, String labelColumn, IMetricsAgent`1 metricsAgent, ITransformer preprocessorTransform, FileInfo modelFileInfo, DataViewSchema modelInputSchema, IChannel logger)
> [Source=ImageClassificationTrainer; ImageClassificationTrainer, Kind=Trace] Channel started
> [Source=ImageClassificationTrainer; Ensuring meta files are present., Kind=Trace] Channel started
> [Source=ImageClassificationTrainer; Ensuring meta files are present., Kind=Trace] Channel finished. Elapsed 00:00:00.0003954.
> [Source=ImageClassificationTrainer; Ensuring meta files are present., Kind=Trace] Channel disposed
> [Source=AutoML, Kind=Error] Pipeline crashed: xf=ValueToKeyMapping{ col=Label:Label} xf=RawByteImageLoading{ col=ImageSource_featurized:ImageSource imageFolder=} xf=ColumnCopying{ col=Features:ImageSource_featurized} tr=ImageClassification{} xf=KeyToValueMapping{ col=PredictedLabel:PredictedLabel} cache=- . Exception: System.FormatException: Tensorflow exception triggered while loading model. ---> System.DllNotFoundException: Não é possível carregar a DLL 'tensorflow': Uma rotina de inicialização da biblioteca de vínculo dinâmico (DLL) falhou. (Exceção de HRESULT: 0x8007045A)
>    em Tensorflow.c_api.TF_NewGraph()
>    em Tensorflow.Graph..ctor()
>    em Microsoft.ML.TensorFlow.TensorFlowUtils.LoadMetaGraph(String path)
>    em Microsoft.ML.TensorFlow.TensorFlowUtils.LoadTFSessionByModelFilePath(IExceptionContext ectx, String modelFile, Boolean metaGraph)
>    --- Fim do rastreamento de pilha de exceções internas ---
>    em Microsoft.ML.TensorFlow.TensorFlowUtils.LoadTFSessionByModelFilePath(IExceptionContext ectx, String modelFile, Boolean metaGraph)
>    em Microsoft.ML.Vision.ImageClassificationTrainer.LoadTensorFlowSessionFromMetaGraph(IHostEnvironment env, Architecture arch)
>    em Microsoft.ML.Vision.ImageClassificationTrainer.InitializeTrainingGraph(IDataView input)
>    em Microsoft.ML.Vision.ImageClassificationTrainer.TrainModelCore(TrainContext trainContext)
>    em Microsoft.ML.Trainers.TrainerEstimatorBase`2.TrainTransformer(IDataView trainSet, IDataView validationSet, IPredictor initPredictor)
>    em Microsoft.ML.Data.EstimatorChain`1.Fit(IDataView input)
>    em Microsoft.ML.Data.EstimatorChain`1.Fit(IDataView input)
>    em Microsoft.ML.AutoML.RunnerUtil.TrainAndScorePipeline[TMetrics](MLContext context, SuggestedPipeline pipeline, IDataView trainData, IDataView validData, String labelColumn, IMetricsAgent`1 metricsAgent, ITransformer preprocessorTransform, FileInfo modelFileInfo, DataViewSchema modelInputSchema, IChannel logger)
> [Source=ImageClassificationTrainer; ImageClassificationTrainer, Kind=Trace] Channel started
> [Source=ImageClassificationTrainer; Ensuring meta files are present., Kind=Trace] Channel started
> [Source=ImageClassificationTrainer; Ensuring meta files are present., Kind=Trace] Channel finished. Elapsed 00:00:00.0004090.
> [Source=ImageClassificationTrainer; Ensuring meta files are present., Kind=Trace] Channel disposed
> [Source=AutoML, Kind=Error] Pipeline crashed: xf=ValueToKeyMapping{ col=Label:Label} xf=RawByteImageLoading{ col=ImageSource_featurized:ImageSource imageFolder=} xf=ColumnCopying{ col=Features:ImageSource_featurized} tr=ImageClassification{} xf=KeyToValueMapping{ col=PredictedLabel:PredictedLabel} cache=- . Exception: System.FormatException: Tensorflow exception triggered while loading model. ---> System.DllNotFoundException: Não é possível carregar a DLL 'tensorflow': Uma rotina de inicialização da biblioteca de vínculo dinâmico (DLL) falhou. (Exceção de HRESULT: 0x8007045A)
>    em Tensorflow.c_api.TF_NewGraph()
>    em Tensorflow.Graph..ctor()
>    em Microsoft.ML.TensorFlow.TensorFlowUtils.LoadMetaGraph(String path)
>    em Microsoft.ML.TensorFlow.TensorFlowUtils.LoadTFSessionByModelFilePath(IExceptionContext ectx, String modelFile, Boolean metaGraph)
>    --- Fim do rastreamento de pilha de exceções internas ---
>    em Microsoft.ML.TensorFlow.TensorFlowUtils.LoadTFSessionByModelFilePath(IExceptionContext ectx, String modelFile, Boolean metaGraph)
>    em Microsoft.ML.Vision.ImageClassificationTrainer.LoadTensorFlowSessionFromMetaGraph(IHostEnvironment env, Architecture arch)
>    em Microsoft.ML.Vision.ImageClassificationTrainer.InitializeTrainingGraph(IDataView input)
>    em Microsoft.ML.Vision.ImageClassificationTrainer.TrainModelCore(TrainContext trainContext)
>    em Microsoft.ML.Trainers.TrainerEstimatorBase`2.TrainTransformer(IDataView trainSet, IDataView validationSet, IPredictor initPredictor)
>    em Microsoft.ML.Data.EstimatorChain`1.Fit(IDataView input)
>    em Microsoft.ML.Data.EstimatorChain`1.Fit(IDataView input)
>    em Microsoft.ML.AutoML.RunnerUtil.TrainAndScorePipeline[TMetrics](MLContext context, SuggestedPipeline pipeline, IDataView trainData, IDataView validData, String labelColumn, IMetricsAgent`1 metricsAgent, ITransformer preprocessorTransform, FileInfo modelFileInfo, DataViewSchema modelInputSchema, IChannel logger)
> [Source=ImageClassificationTrainer; ImageClassificationTrainer, Kind=Trace] Channel started
> [Source=ImageClassificationTrainer; Ensuring meta files are present., Kind=Trace] Channel started
> [Source=ImageClassificationTrainer; Ensuring meta files are present., Kind=Trace] Channel finished. Elapsed 00:00:00.0003738.
> [Source=ImageClassificationTrainer; Ensuring meta files are present., Kind=Trace] Channel disposed
> [Source=AutoML, Kind=Error] Pipeline crashed: xf=ValueToKeyMapping{ col=Label:Label} xf=RawByteImageLoading{ col=ImageSource_featurized:ImageSource imageFolder=} xf=ColumnCopying{ col=Features:ImageSource_featurized} tr=ImageClassification{} xf=KeyToValueMapping{ col=PredictedLabel:PredictedLabel} cache=- . Exception: System.FormatException: Tensorflow exception triggered while loading model. ---> System.DllNotFoundException: Não é possível carregar a DLL 'tensorflow': Uma rotina de inicialização da biblioteca de vínculo dinâmico (DLL) falhou. (Exceção de HRESULT: 0x8007045A)
>    em Tensorflow.c_api.TF_NewGraph()
>    em Tensorflow.Graph..ctor()
>    em Microsoft.ML.TensorFlow.TensorFlowUtils.LoadMetaGraph(String path)
>    em Microsoft.ML.TensorFlow.TensorFlowUtils.LoadTFSessionByModelFilePath(IExceptionContext ectx, String modelFile, Boolean metaGraph)
>    --- Fim do rastreamento de pilha de exceções internas ---
>    em Microsoft.ML.TensorFlow.TensorFlowUtils.LoadTFSessionByModelFilePath(IExceptionContext ectx, String modelFile, Boolean metaGraph)
>    em Microsoft.ML.Vision.ImageClassificationTrainer.LoadTensorFlowSessionFromMetaGraph(IHostEnvironment env, Architecture arch)
>    em Microsoft.ML.Vision.ImageClassificationTrainer.InitializeTrainingGraph(IDataView input)
>    em Microsoft.ML.Vision.ImageClassificationTrainer.TrainModelCore(TrainContext trainContext)
>    em Microsoft.ML.Trainers.TrainerEstimatorBase`2.TrainTransformer(IDataView trainSet, IDataView validationSet, IPredictor initPredictor)
>    em Microsoft.ML.Data.EstimatorChain`1.Fit(IDataView input)
>    em Microsoft.ML.Data.EstimatorChain`1.Fit(IDataView input)
>    em Microsoft.ML.AutoML.RunnerUtil.TrainAndScorePipeline[TMetrics](MLContext context, SuggestedPipeline pipeline, IDataView trainData, IDataView validData, String labelColumn, IMetricsAgent`1 metricsAgent, ITransformer preprocessorTransform, FileInfo modelFileInfo, DataViewSchema modelInputSchema, IChannel logger)
> [Source=ImageClassificationTrainer; ImageClassificationTrainer, Kind=Trace] Channel started
> [Source=ImageClassificationTrainer; Ensuring meta files are present., Kind=Trace] Channel started
> [Source=ImageClassificationTrainer; Ensuring meta files are present., Kind=Trace] Channel finished. Elapsed 00:00:00.0004048.
> [Source=ImageClassificationTrainer; Ensuring meta files are present., Kind=Trace] Channel disposed
> [Source=AutoML, Kind=Error] Pipeline crashed: xf=ValueToKeyMapping{ col=Label:Label} xf=RawByteImageLoading{ col=ImageSource_featurized:ImageSource imageFolder=} xf=ColumnCopying{ col=Features:ImageSource_featurized} tr=ImageClassification{} xf=KeyToValueMapping{ col=PredictedLabel:PredictedLabel} cache=- . Exception: System.FormatException: Tensorflow exception triggered while loading model. ---> System.DllNotFoundException: Não é possível carregar a DLL 'tensorflow': Uma rotina de inicialização da biblioteca de vínculo dinâmico (DLL) falhou. (Exceção de HRESULT: 0x8007045A)
>    em Tensorflow.c_api.TF_NewGraph()
>    em Tensorflow.Graph..ctor()
>    em Microsoft.ML.TensorFlow.TensorFlowUtils.LoadMetaGraph(String path)
>    em Microsoft.ML.TensorFlow.TensorFlowUtils.LoadTFSessionByModelFilePath(IExceptionContext ectx, String modelFile, Boolean metaGraph)
>    --- Fim do rastreamento de pilha de exceções internas ---
>    em Microsoft.ML.TensorFlow.TensorFlowUtils.LoadTFSessionByModelFilePath(IExceptionContext ectx, String modelFile, Boolean metaGraph)
>    em Microsoft.ML.Vision.ImageClassificationTrainer.LoadTensorFlowSessionFromMetaGraph(IHostEnvironment env, Architecture arch)
>    em Microsoft.ML.Vision.ImageClassificationTrainer.InitializeTrainingGraph(IDataView input)
>    em Microsoft.ML.Vision.ImageClassificationTrainer.TrainModelCore(TrainContext trainContext)
>    em Microsoft.ML.Trainers.TrainerEstimatorBase`2.TrainTransformer(IDataView trainSet, IDataView validationSet, IPredictor initPredictor)
>    em Microsoft.ML.Data.EstimatorChain`1.Fit(IDataView input)
>    em Microsoft.ML.Data.EstimatorChain`1.Fit(IDataView input)
>    em Microsoft.ML.AutoML.RunnerUtil.TrainAndScorePipeline[TMetrics](MLContext context, SuggestedPipeline pipeline, IDataView trainData, IDataView validData, String labelColumn, IMetricsAgent`1 metricsAgent, ITransformer preprocessorTransform, FileInfo modelFileInfo, DataViewSchema modelInputSchema, IChannel logger)
> [Source=ImageClassificationTrainer; ImageClassificationTrainer, Kind=Trace] Channel started
> Tensorflow exception triggered while loading model.
> 
> 
Lynx1820 commented 4 years ago

I'm not able to replicate the error. Did you mean 8,000 images? You still get the error with a smaller dataset, right? What version of ML.NET and Visual Studio are you using? It seems like your missing the tensorflow dll. @justinormont Do you have any pointers for why his project can't find the dll?

luislhg commented 4 years ago

I'm not able to replicate the error. Did you mean 8,000 images? You still get the error with a smaller dataset, right? What version of ML.NET and Visual Studio are you using? It seems like your missing the tensorflow dll. @justinormont Do you have any pointers for why his project can't find the dll?

Yes, 8 thousand images (8,000). I've just tried, and yes, got the exactly same error even with 95 images only. I'm using Visual Studio 2019 Professional 16.4.6. I'm using ML.NET Model Builder (Preview) 16.0.2003.302.

Lynx1820 commented 4 years ago

I tried this on Visual Studio 2019 Professional 16.5 with the Model Builder/.NET core version you provided, but I was not able to reproduce the error. Can you try upgrading your Visual Studio version?

luislhg commented 4 years ago

Hi. I just tried with the VS 2019 Professional 16.5 (just updated). Exactly same issue and log.

Do you need any other system spec?

Is the Windows language/culture relevant?

harishsk commented 4 years ago

@luislhg Let me transfer the issue over to the Model Builder team and see if they have any ideas.

luislhg commented 4 years ago

Any news?

LittleLittleCloud commented 4 years ago

Sorry for the late reply.

Based on the log, it says modelbuilder can't find tensorflow.dll in it's package and throws a DLL not found exception.

What's your system language, And can you go to %Temp%MLNET folder to see if there's a file named resnet_v2_50_299.meta?

@codemzs any ideas?

luislhg commented 4 years ago

Hello, my system language/culture is PT-BR (ptBR).

Regarding the folder/file, it is never able to download the file in vs/modelbuilder, it always fails while downloading. _([Source=ImageClassificationTrainer; Ensuring meta files are present., Kind=Error] resnet_v2_50299.meta: Download timed out)

So I downloaded the resnet_v2_50_299.meta file myself through Chrome (https://aka.ms/mlnet-resources/resnet_v2_50_299.meta) and placed it there.

Then it can proceed, as it checks the file exists, but when training the data it throws the exception that you can see in my issue's image.

LittleLittleCloud commented 4 years ago

Hey @codemzs any updates on this issue?

LittleLittleCloud commented 4 years ago

Seems to be an issue with ML.Net's ImageClassification API, Could you guys help take a look

frank-dong-ms-zz commented 4 years ago

@luislhg Could you please provide a repro project so I can try to reproduce in my local? I tried what you said and also no repro.

luislhg commented 4 years ago

@frank-dong-ms Yes... although it is not really project dependent... I just followed the repro steps at my first post reporting the issue.

This is the project (just a blank WPF .NET 4.8 project, I already tried with others and with .NET Core 3.1 as well, same issue) But here it goes: MLNET_IssueReport.zip

Also I recorded the repro steps so you can see clearly: https://www.dropbox.com/s/tl1iinoxysjrz52/Report%20MachineLearning%20TensorFlow%20Issue.mp4?dl=0

frank-dong-ms-zz commented 4 years ago

@luislhg Thanks, I download your project and still no repro. Could you try to install latest version of Model Builder (if it is already have latest version please try to remove and install Model Builder again). Also, are you able to repro this issue in other computer? I tried on several different computers and they all works fine.

luislhg commented 4 years ago

@frank-dong-ms Ok, so two scenarios.

1) I uninstalled the extension and installed again on this computer and still nothing. Same error.

2) I did try on a newer laptop (with newer generation of I7) and it did work apparently (just the ResNet download still times out, I had to download manually and place it in the temp folder).

So I did some research and apparently TensorFlow doesn't work with the older generations of intel. I assume this could be the issue, but it's just a hunch.

LittleLittleCloud commented 4 years ago

@frank-dong-ms Maybe it's a bug in Tensorflow.Net, could you try to upgrade it's dependency to 1.15.1(the latest one) and see if problems go?

frank-dong-ms-zz commented 4 years ago

@LittleLittleCloud I'm curious why do you think it's bug in TF.NET?

I can make a new ML.NET package with latest version of TF.NET, how to use that package in model builder and verify on customer's machine? Currently we don't have a way to repro this issue in any of our machine.

LittleLittleCloud commented 4 years ago

@LittleLittleCloud I'm curious why do you think it's bug in TF.NET?

I can make a new ML.NET package with latest version of TF.NET, how to use that package in model builder and verify on customer's machine? Currently we don't have a way to repro this issue in any of our machine.

I'm just guessing,,, because ImageClassificationTrainer uses TF.Net to load a pretrain-resnet model, and that's where the exception is thrown. Along with the fact that tensorFlow doesn't work with the older generations of intel and TF.Net is a c# binding to tensorflow, that guides me to make that guess. Considering that right now ImageClassifcationTrainer still uses TF.Net 1.14 and TF.Net 1.15 is released,, so I'm wondering if upgrade to 1.15 might solve this issue

luislhg commented 4 years ago

@frank-dong-ms I can debug on that machine or even allow a remote access if needed. I do believe it might be a bug in TF.NET/Tensorflow as other people have already stated issues using TensorFlow with older processors. Regardless of a fix for that, I believe ModelBuilder should just detect old processors, stop the process and nicely notify it isn't supported. Assuming this is the processor's fault.

Please let me know if there is anything I can do to assist.

frank-dong-ms-zz commented 4 years ago

Sorry for late response. Found a similar issue: https://github.com/dotnet/machinelearning/issues/4679

@luislhg Thanks, so model builder is working on your new computer with same language/culture setting, right? Also, could you please try to download https://github.com/dotnet/machinelearning-samples and try to run some image classification samples on your computer(computer with dll not found issue) see if you can repro the dll not found issue?

frank-dong-ms-zz commented 4 years ago

Can't repro this issue, currently don't have much we can do from our side, close this issue now, feel free to reopen if necessary @luislhg

DeanHnter commented 3 years ago

This issue seems to have come back but seems to be the url https://aka.ms/mlnet-resources/resnet_v2_50_299.meta no longer exists and so can't download the files even via browser but also when starting a new classification model from the model builder.

torronen commented 3 years ago

Yes, it would seem the file no longer exists at the location where it should be?

[Source=ImageClassificationTrainer; Ensuring meta files are present., Kind=Error] resnet_v2_50_299.meta: Could not download. WebClient returned the following error: The remote name could not be resolved: 'mlnetresources.blob.core.windows.net'

https://aka.ms/mlnet-resources/meta/resnet_v2_50_299.meta is not available

Skyppid commented 3 years ago

Can replicate this. I can't train my model due to the file not being available under that URL. Has anyone an alternative link? The error says you can put it there manually, but I can't even find it on the web...