我在keras model.fit上收到“ ValueError:设置具有序列的数组元素”
model.fit(X_tr,np.array(y_tr),batch_size=32,epochs=5,validation_split=0.1,verbose=1)
X_tr
Out[22]:
array([[4256,1244,4475,...,8766,8766],[5443,3401,4709,[3829,543,681,[2185,7510,8004,[7562,5842,4742,[2449,6217,2310,8766]],dtype=int32)
X_tr.shape
(2699,75)
np.array(y_tr)
Out[37]:
array([array([[0.,0.,1.,0.],[0.,0.]],dtype=float32)],dtype=object)
np.array(y_tr).shape
(2699,)
我很困惑,有人能帮助我吗?提前致谢!
如果您需要代码:https://github.com/sunsuntianyi/question/blob/master/LSTM.ipynb
最佳答案
原文链接:https://www.f2er.com/python/533318.html