使用sklearn中SVC时出现ValueError: setting an array element with a sequence.的错误应该怎么解决?

rt

错误信息:

File "\svm_weighted.py", line 30, in weighted
res = svm.SVC(kernel='linear').fit(X,Y)

File "\Anaconda3\lib\site-packages\sklearn\svm\base.py", line 149, in fit
X, y = check_X_y(X, y, dtype=np.float64, order='C', accept_sparse='csr')

File "\Anaconda3\lib\site-packages\sklearn\utils\validation.py", line 542, in check_X_y
ensure_min_features, warn_on_dtype, estimator)

File "\Anaconda3\lib\site-packages\sklearn\utils\validation.py", line 402, in check_array
array = np.array(array, dtype=dtype, order=order, copy=copy)
ValueError: setting an array element with a sequence.

x,y的大小分别如下:

x Tensor("concat_78:0", shape=(?, 12), dtype=float32)
y (12,)

https://blog.csdn.net/Poo_Chai/article/details/91040938