M_A2には59*59の定数が入ります
xには50*59が下記のモデルから入りますが
下記コード
model.add(Lambda(dot1))の部分でエラーが発生します。
--> 619 dims = x.get_shape()._dims
620 if dims is not None:
621 return len(dims)
AttributeError: 'numpy.ndarray' object has no attribute 'get_shape'というエラーがでます.
def dot1(x):
return keras.backend.dot(x,M_A2)
モデルを作成
model = Sequential()#cov1dの場合は
model.add(Conv1D(filters=filter1,kernel_size=kernel,strides=strides, padding='same',input_shape=(x_train.shape[1],1)))#
model.add(Activation(Act))
model.add(Dense(50))#
model.add(Activation(Act))
model.add(Lambda(dot1))
============================================
conv1d_1 (Conv1D) (None, 59, 100) 400
activation_1 (Activation) (None, 59, 100) 0
dense_1 (Dense) (None, 59, 50) 5050
activation_2 (Activation) (None, 59, 50) 0
あなたの回答
tips
プレビュー