dotnet / machinelearning-samples

Samples for ML.NET, an open source and cross-platform machine learning framework for .NET.
https://dot.net/ml
MIT License
4.46k stars 2.68k forks source link

'Unable to find an entry point named 'TF_StringEncodedSize' in DLL 'tensorflow'.' #880

Open masgh021 opened 3 years ago

masgh021 commented 3 years ago

i test this sample sample with winform application , But when i run app in this line

var prediction = predictionEngine.Predict(imageToPredict);

i get this error System.EntryPointNotFoundException: 'Unable to find an entry point named 'TF_StringEncodedSize' in DLL 'tensorflow'.'

in that sample model is ok and all process run well, but in my app i got this error .

tondangerza commented 3 years ago

I think ml.net support tensorflow 2.3.1 not yet support 2.4, so you must download SciSharp.TensorFlow.Redist 2.3.1

masgh021 commented 3 years ago

@tondangerza @Oceania2018 i tested these version SciSharp.TensorFlow.Redist 2.3.1 and 2.3 and 2.4 but i have this error now , i dont know where is the problem .

tondangerza commented 3 years ago

@masgh021 I try install tensorflow 2.4.1 and run application after that I got error "Unable to find an entry point named 'TF_StringEncodedSize' in DLL 'tensorflow'.":"" same

and I think you should check Debug folder that tensorflow.dll, if v.2.3.1(CPU) size should to be 141MB try delete it and re-build. image

masgh021 commented 3 years ago

@tondangerza
i delete tensorflow.dll(146MB) and rebuild with version 2.3.1 and it's size change to 141MB and it worked for me , thanks man for help . i have another question , how make a image classification model with model builder that it use in-memory image ?

rvdinter commented 2 years ago

@tondangerza When using SciSharp.TensorFlow.Redist-Windows-GPU v2.4.0 with CUDA 11.0 and CUDNN v8.0.4, I get the same error 'Unable to find an entry point named 'TF_StringEncodedSize' in DLL 'tensorflow'.'. Rebuilding with version v2.3.0 or v2.3.1 with CUDA 10.1 and CUDNN v7.6.5.32 however provide another error: CUDA error: no kernel image is available for execution on the device This StackOverflow question proposes that my Quadro M1200 is not compatible with v2.3.x. How should I move on?

fuszenecker commented 10 months ago

Same in DeepLearning_ImageClassification:

Exception has occurred: CLR/System.EntryPointNotFoundException
An unhandled exception of type 'System.EntryPointNotFoundException' occurred in Microsoft.ML.Vision.dll: 'Unable to find an entry point named 'TF_StringEncodedSize' in DLL 'tensorflow'.'
<PackageReference Include="SciSharp.TensorFlow.Redist-Windows-GPU" Version="2.10.3" />

Seems to work with:

<PackageReference Include="SciSharp.TensorFlow.Redist-Windows-GPU" Version="2.3.1" />

The issue still occurres with the latest pre-release ML.NET:

    <PackageReference Include="Microsoft.ML" Version="3.0.0-preview.23511.1" />
    <PackageReference Include="Microsoft.ML.ImageAnalytics" Version="3.0.0-preview.23511.1" />
    <PackageReference Include="Microsoft.ML.Vision" Version="3.0.0-preview.23511.1" />
    <!--PackageReference Include="SciSharp.TensorFlow.Redist" Version="2.3.1" /-->
    <PackageReference Include="SciSharp.TensorFlow.Redist-Windows-GPU" Version="2.10.3" />
NakanoMiku13 commented 1 month ago

If it works for anyone, I've read to many posts, but only that work for me was downgrading TensorFlow.NET (0.150.0 -> 0.100.5) and TensorFlow.Keras (0.15.0 -> 0.10.5); CUDA 11.7 - cuDNN 8.9 QUADRO MOBILE T1000 8GB PackageReference Include="TensorFlow.Keras" Version="0.10.5" PackageReference Include="TensorFlow.NET" Version="0.100.5" PackageReference Include="SciSharp.TensorFlow.Redist-Windows-GPU" Version="2.10.3" But I found another problems (Could not locate zlibwapi.dll. Please make sure it is in your library path), like missing dll's (zlibwapi.dll), how I fix it was copying the file zlib.dll from C:\Program Files\NVIDIA Corporation\Nsight Systems 2022.1.3\host-windows-x64 and paste it on C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\bin

Another problem that I found after that was a compiling error (Tensorflow.TensorflowException: 'DNN library is not found.'), I search and forums only suggest that could be cuDNN version, so I downgrade again now from cuDNN 8.9 to cuDNN 8.4.1 (verify that is for CUDA 11.X) there I solve all the problems.

My current problem is OOM (so sad), but It works finally.

Hopefully it works for you.

Where I found the information and other links that could help: https://github.com/SciSharp/TensorFlow.NET/issues/1224 https://forum.image.sc/t/dnn-library-is-not-found-problem-with-tensorflow/81673 https://developer.nvidia.com/compute/cudnn/secure/8.4.1/local_installers/11.6/cudnn-windows-x86_64-8.4.1.50_cuda11.6-archive.zip (for windows) https://developer.nvidia.com/rdp/cudnn-archive https://stackoverflow.com/questions/72356588/could-not-locate-zlibwapi-dll-please-make-sure-it-is-in-your-library-path