TensorFlow.NET icon indicating copy to clipboard operation
TensorFlow.NET copied to clipboard

[BUG Report]: GPU LSTM,erro:System.EntryPointNotFoundException:“Unable to find an entry point named 'TF_GetHandleShapeAndType' in DLL 'tensorflow'.”

Open xuse2008 opened this issue 1 year ago • 2 comments

Description

When CPU is OK,When GPU,then: 如图: image

image

Reproduction Steps

No response

Known Workarounds

No response

Configuration and Other Information

Win11,cuda_11.8.0 cudnn-x86_64-8.6.0 No response

xuse2008 avatar Jul 08 '24 15:07 xuse2008

Hello there! I'm not part of the dev team but I may have the workaround for you. (I actually tested your code on Win10 and it actually runs with 0 issues.)

The problem

Native Windows GPU support is no longer a thing. If you read the docs they show you which versions are compatible. As you may see cuda 11.8 isn't even on the page...

WARNING

I can see that you try to use LSTM. This version of Tensorflow.NET can save this layer, but can't load it back (I couldn't find a version where this wasn't a problem). Please check whether it's possible with your environment.

My solution

Just downgrade the version of your NuGet packages until native GPU support comes back. Right now this seems the fastest way to do it. This you can train and run a model in this environment on GPU:

Package Version
SciSharp.TensorFlow.Redist-Windows-GPU 2.10.3
TensorFlow.Keras 0.11.4
TensorFlow.NET 0.110.4

But saving it could be problematic as I've mentioned.

Workaround

IF the save method actually supported save_formats which would be compatible with the Tensorflow python library then you could just simply save the model and use WSL2 for training. (This would require a little python scripting). But right now this is not possible.

Kristof-me avatar Jul 27 '24 21:07 Kristof-me

退回到TensorFlow.NET | 0.110.4 版本真的有用,Win11,cuda_11.0.2 cudnn-x86_64-8.6.0

xdaker avatar Jul 23 '25 03:07 xdaker