我是深度学习库 Keras 的新手,需要您的帮助。模型构建没有错误,但在调用 model.fit(X, y) 时出现以下问题:
TypeError: ('Bad input argument to theano function with name "~/machine_learning2/lib/python2.7/site-packages/keras/backend/theano_backend.py:380"
at index 0(0-based)', 'Wrong number of dimensions: expected 3, got 2 with shape (16, 40).')
这类似于https://github.com/fchollet/keras/issues/815 我的 y 训练矩阵是一个多行一列的矩阵。
提到的一种解决方案是使用二进制 one-hot 编码将 y 转换为 3d 张量。有这样的例子吗?