-
Notifications
You must be signed in to change notification settings - Fork 536
[BUG Report]: LSTM/RNN model throws Null Pointer Exception #1082
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hmm, - I started working through all the GPU errors and I think that might actually be the root cause - at least post installation of cuDNN, it's failing in a different way, though it might just be failing now at GPU setup and not getting to the error above |
Hi, sorry for the confusion. This error is due to the incompletion of RNN (expected to be completed in #1081 ). Please give us some times to complete that work. Thank you for your patience. :) |
Edit: looks like the PR merged. I'll start by pulling the code and seeing if my example runs now! - thanks. And apologies for slow reply at my end, but thanks for your quick answer, it at least stopped me going crazy short term. Do you have any advice here - should I test the branch, can I help with testing or completing anything? Would it be wise to switch to different library if I need to get this project done near term :( - I love the overall library, and would be happy to be helpful, with the caveat that I do pretty much exclusively F# nowadays. I did think some more examples for the library and / or tests that exercise the basics would be a nice addition, both to help people starting with it, and to verify the basics. I'll take a look at the PR anyway and see how it's coming along. Thanks again - Darren |
Sorry, the RNN hasn't been completed yet, the situation is SimpleRNN, StackedRnnCell, the SimpleRnncell is done, the RNN in Eager mode is done, but there's a little problem in graph mode,you can follow the rnn-dev branch to keep up with the latest developments. And thank you for your interest in TensorFlow.NET. |
Without wanting to slow you down, I am trying the Edit <ignore last error, that's a library version problem). Currently bumping up against this. Feels like progress! I'm also trying to move to WSL2 / gpu support - probably something dumb I'm doing here but thanks for listening. As best I can tell, the error below is due to how I'm setting up the model - it's not ready for eager execution despite me efforts. I'm not sure I can get it into that form, so I might just have to wait till you get the graph mode kinks worked out. Again let me know if I can help, Darren
|
I'm not familiar with F#, and I tested in rnn-dev using the C# code below and it worked well:
Are you using the latest rnn-dev branch? If it is, I will test F# code again to see if there exist some bug. |
Thanks again for your patience and quick replies. The recent problems have been during the data fitting stage (once I joined the rnn-dev branch, the null pointer errors went away. I can confirm the code above works (for what it's worth, here is the F# equivalent - it's almost identical). I will try to build a better example that also exercises the
really be
|
The new release version has been released, you can update your TensorFlow.NET and TensorFlow.Keras version to use LSTM and RNN. ^_^ |
Nice! - I can confirm that the model building stages all run smoothly with the latest package. The full example below still blows up on the last line when it tries to fit this toy data, because of the issue in #916, so I can't fully confirm it's all working, but I trust you have it in hand
|
Thanks for the fix to #916 , I was able to verify the LSTM model isn't blowing up anymore in my test case. Closing this, and thanks again for the hard work. |
Description
RNN.cs line 42 gets null pointer referencing
!cell.Built
during model construction.With the preface that I love this library, and it is likely a mistake on my part triggering this problem, a null pointer exception isn't a great user experience, so this can minimally provide better feedback (plus, would like to know what I'm doing wrong here - the docs for TensorNet.Keras aren't that extensive unless I missed something.
Reproduction Steps
This is a code fragment reproducing the issue. Save the code as
example.fsx
and run it from command line asdotnet fsi example.fsx
When run, I see a stream of GPU errors and then the traceback at the bottom.
In order to capture the faulting line number, I built the libraries from the current main branch and ran locally against those to isolate the problem to line 42 of
RNN.cs
. Specifically cell appears to be null so something is going wrong during class setup.Thoughts and help appreciated.
p.s. are there decent examples of using the Keras library with Tensor.Net - I am mostly going from python examples but would love to see a few fully worked cases.
Known Workarounds
None I can find so far.
Configuration and Other Information
I am testing on a Win11 machine, from a bash prompt with a Quadro GPU (I don't think that's relevant) and I may not have the CUDA drivers installed properly (also likely not relevant). Dotnet runtime is 7.0.203. The code breaks against both the most current nuget versions of the libraries shown below and also the current main branch of the github repo
The text was updated successfully, but these errors were encountered: