`ValueError: setting an array element with a sequence.` while using grad
See original GitHub issueHello all, I am using grad for calculating the derivative of my fitness function. However I am getting a value error as following:
ValueError: setting an array element with a sequence.
I printed the type and value of the final output and find that the value contains the text also. Can anyone suggest me what should I do ?
Print of Type and Value:
Type of Output <class 'autograd.numpy.numpy_boxes.ArrayBox'>
Value of Output= Autograd ArrayBox with value Autograd ArrayBox with value Autograd ArrayBox with value Autograd ArrayBox with value -32.248885305979115
I suppose, because of that text the function creating problem while return the value. Looking forward for your help. Thank You
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:10 (4 by maintainers)
Top Results From Across the Web
ValueError: setting an array element with a sequence.
Python Autograd Not working "ValueError: setting an array element with a ... I am trying to compute the Jacobian of this function but...
Read more >How to Fix: ValueError: setting an array element with a ...
Easiest way to fix this problem is to use the data-type which support all type of data-type. · Second way to fix this...
Read more >ValueError setting an array element with a sequence - Edureka
I am getting this error: File "mypath\mypythonscript.py", line 3484, in secondfunction RRDuringArray = ... explain to me how to fix this ...
Read more >ValueError: setting an array element with a sequence
However, it's almost never a good idea to use for loop to assign elements to a tensor. In your case, you should try...
Read more >Using sklearn in cost function - PennyLane Help
I am trying to use sklearn regression within my cost function, but that seems to ... ValueError: setting an array element with a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I suspect you can fix these problems by changing
import numpy as np
toimport autograd.numpy as np
Sorry, I’ve edited it to be reproducible. I forgot I was loading the data from file at first.