Using Python, we are writing a code to obtain the slope of the neural network loss function.
Here's the code.
At this time,
self.The parameters [key] are two-dimensional
list indicating weights or biases
self.If you try to access the parameters [key][i][j] , the value appears
TypeError: Cannot proceed with 'float' object is not writable error.
I looked it up on the Internet and found that it is an error that appears when accessing variables other than
list as indexes
In my case,
self normally.The corresponding error appears at the same time as the value of param[key][i][j] appears.
What should I do?python
At first, the parameters [key] are two dimensions. However, at the end of the for statement, the type changes when you assign param [key] = tmp_val.
© 2022 pinfo. All rights reserved.