Cannot convert arrays to ndarray
See original GitHub issueWhen I try to convert any array to ndarray I get this error:
System.ArgumentException: ‘Object contains non-primitive or non-blittable data.’
and I get the error in the new NDArray
var ctx = mx.Cpu();
float[][] labels= training_labels.ToArray(); // [1000][1]
var train_y1 = new NDArray(labels, new Shape(labels.Count(), 1), ctx: ctx, DType.Float16);
Is there a way to convert List of array of floats to NDArray ?
Thanks!
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Tulipy Cannot convert Series to numpy.ndarray
Tulipy requires numpy as all inputs and outputs are numpy arrays (dtype=np.float64). Yet with data['close'] you are passing a pd.Series . The ...
Read more >How to convert to/from NumPy
Implicit conversion to NumPy inherits the same restrictions as ak.to_numpy() , namely that variable-length lists cannot be converted to NumPy.
Read more >Cannot Convert a Symbolic Tensor to a Numpy Array
This is because the numpy() function is designed to convert EagerTensors (which hold actual values) into numpy arrays, not symbolic tensors.
Read more >Cannot convert <class 'numpy.ndarray'> to TensorType'
It seems like theano is unable to convert cov from a numpy array to a tensor, but in it seems to be the...
Read more >Cannot convert array to set in java. Getting error
I am solving a leetcode problem in which I have to convert an array into set. My code is class Solution { public...
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 FreeTop 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
Top GitHub Comments
Glad it worked, I will have a look into IEnumerable and probably will try to fix that.
On Fri, Apr 9, 2021 at 3:57 AM evo11x @.***> wrote:
– Regards, Deepak
Is there an NDArray function to add elements? or change values of the array? I still having problems copying the 3D array to float[,] and it would be useful to create the NDArray directly from my list of arrays without creating a float[,] first.