How to solve Exception: No gradient attached to this NDArray #1041
-
djl version: 0.11.0 so, second I writed a other function: so,third I change the function(requiresGrad) :
how to solve the question? thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Please take a look D2L book: https://d2l.djl.ai/chapter_preliminaries/autograd.html You can get latest version here: https://github.com/deepjavalibrary/d2l-java/blob/master/chapter_preliminaries/autograd.ipynb |
Beta Was this translation helpful? Give feedback.
-
I kown why requiresGrad function is not work! The key point is to put zhe function after the |
Beta Was this translation helpful? Give feedback.
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 beforeNDList results = net.forward(parameterStore, X, true);
.then we get the Exception(The array has not been initialized)