Both U32 and S32 indicate that your numpy array is a string array, not a number array. Check whether there are strings in the dataset. If there are, just delete them. In numpy array, as long as one item is string, the type returned by the array is string array.
If you need to convert numpy to floating-point number, please refer to the code:
train= train.astype (float)
train_ target = train_ target.astype (float)
Read More:
- [Solved] ufunc ‘add‘ did not contain a loop with signature matching types (dtype(‘<U32‘), dtype(‘<U32‘))
- [Solved] RuntimeError: scatter(): Expected dtype int64 for index
- [Solved] RuntimeError: gather(): Expected dtype int64 for index
- dtype=np.int error: DeprecationWarning: `np.int` is a deprecated alias for the builtin `int`.
- To silence this warning, use `float` by itself. Doing this will not modify any behavior and is safe.
- Normalize error: TypeError: Input tensor should be a float tensor…
- [Solved] Pytorch Error: RuntimeError: expected scalar type Double but found Float
- ValueError: Found array with dim 4. Estimator expected and ValueError: Expected 2D array, got 1D array i
- can‘t multiply sequence by non-int of type ‘numpy.float64‘
- [Solved] RuntimeError: expected scalar type Long but found Float
- [Solved] cv2.error: (-215:Assertion failed) encoder->isFormatSupported(CV_8U) in function ‘imwrite_‘
- Python IndexError: too many indices for array: array is 1-dimensional, but 2 were i..
- [Solved] Runtime error: expected scalar type Float but found Double
- [Solved] YOLOv5 Model training error: TypeError: new(): invalid data type ‘str’
- Pytorch Error: RuntimeError: value cannot be converted to type float without overflow: (0.00655336,-0.00
- Extracting Data from XML (Using Python to Access Web Data)
- Python 3.X error: valueerror: data type must provide an itemsize
- Python quote error: * * * keyerror: u ‘\ uxx’ [How to Solve]
- Python: Panda scramble data
- Pytorch Error: runtimeerror: expected scalar type double but found float