Skip to content
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

Nullpointerexception in ComputationGraph.outputOfLayersDetached #10034

Open
cyberbeat opened this issue Sep 23, 2023 · 0 comments
Open

Nullpointerexception in ComputationGraph.outputOfLayersDetached #10034

cyberbeat opened this issue Sep 23, 2023 · 0 comments

Comments

@cyberbeat
Copy link
Contributor

I have a network with:

EmbeddingSequenceLayer
LastTimeStepVertex
LossLayer

and defined both, LastTimeStepVertex and LossLayer as output (for debugging purposes).

Training works, but inference throws an exception:

Exception in thread "main" java.lang.NullPointerException: Cannot invoke "org.deeplearning4j.nn.workspace.LayerWorkspaceMgr.setHelperWorkspacePointers(java.util.Map)" because "workspaceMgr" is null
	at org.deeplearning4j.nn.graph.ComputationGraph.outputOfLayersDetached(ComputationGraph.java:2335)
	at org.deeplearning4j.nn.graph.ComputationGraph.output(ComputationGraph.java:1882)
...

In ComputationGraph.outputOfLayersDetached this code in line 2322 seems risky:

                if (closeAtEndIteraton[i] != null) {
                    for (MemoryWorkspace wsAct : closeAtEndIteraton[i]) {
                        wsAct.close();
                        LayerWorkspaceMgr canNowReuse = openActivationsWorkspaces.remove(wsAct);
                        freeWorkspaceManagers.add(canNowReuse);
                    }
                }

canNowReuse may be null - and is in my case, I tested with a if ..!=null statement before freeWorkspaceManagers.add(canNowReuse);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant