dotnet / machinelearning

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

Unhandled exception. System.EntryPointNotFoundException: Unable to find an entry point named 'TF_StringEncodedSize' in shared library 'tensorflow'. #6893

Closed fuszenecker closed 7 months ago

fuszenecker commented 7 months ago

System Information (please complete the following information):

Describe the bug When I try to train a model for image classification, I receive the exception below:

Unhandled exception. System.EntryPointNotFoundException: Unable to find an entry point named 'TF_StringEncodedSize' in shared library 'tensorflow'.
   at Tensorflow.c_api.TF_StringEncodedSize(UInt64 len)
   at Microsoft.ML.Vision.ImageClassificationTrainer.EncodeByteAsString(VBuffer`1 buffer)
   at Microsoft.ML.Vision.ImageClassificationTrainer.ImageProcessor.ProcessImage(VBuffer`1& imageBuffer)
   at Microsoft.ML.Vision.ImageClassificationTrainer.CacheFeaturizedImagesToDisk(IDataView input, String labelColumnName, String imageColumnName, ImageProcessor imageProcessor, String inputTensorName, String outputTensorName, String cacheFilePath, Dataset dataset, Action`1 metricsCallback, Nullable`1 validationFraction)
   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>$(String[] args) in /home/fuszenecker/dev/zp/Program.cs:line 25

To Reproduce Steps to reproduce the behavior:

  1. Update the SciSharp.TensorFlow.Redist package from 2.3.1 to 2.16.0.
  2. See error

Expected behavior No exception received, the classification works as expected.

Screenshots, Code, Sample Projects

  <ItemGroup>
    <PackageReference Include="Microsoft.ML.Mkl.Redist" Version="3.0.0" />
    <PackageReference Include="Microsoft.ML.ImageAnalytics" Version="3.0.0" />
    <PackageReference Include="Microsoft.ML.Vision" Version="3.0.0" />
    <PackageReference Include="SciSharp.TensorFlow.Redist" Version="2.16.0" />
  </ItemGroup>

Additional context

luisquintanilla commented 7 months ago

Hi @fuszenecker

For TensorFlow, we currently support up to version 2.3.1. Changing the version to 2.3.1 should address this issue.