Skip to content

How to solve Exception: No gradient attached to this NDArray #1041

Answered by kameronren
kameronren asked this question in Q&A
Discussion options

You must be logged in to vote

I kown why requiresGrad function is not work! The key point is to put zhe function after the NDList results = net.forward(parameterStore, X, true); If put the requiresGrad function before NDList results = net.forward(parameterStore, X, true); .then we get the Exception(The array has not been initialized)

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by kameronren
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants