python模型训练出现维度不匹配的错误

Original stack trace for 'loss/activation_34_loss/mul':
File "ecg/train.py", line 115, in
train(args, params)
File "ecg/train.py", line 57, in train
model = network.build_network(**params)
File "D:\PyCharm2020\pycharmproject\wuenda\ecg-master\ecg\network.py", line 142, in build_network
add_compile(model, **params)
File "D:\PyCharm2020\pycharmproject\wuenda\ecg-master\ecg\network.py", line 124, in add_compile
metrics=['accuracy'])
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\keras\engine\training.py", line 830, in compile
sample_weight, mask)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\keras\engine\training.py", line 429, in weighted
score_array = fn(y_true, y_pred)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\keras\losses.py", line 69, in categorical_crossentropy
return K.categorical_crossentropy(y_true, y_pred)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\keras\backend\tensorflow_backend.py", line 3015, in categorical_crossentr
opy
return - tf.reduce_sum(target * tf.log(output),
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\ops\math_ops.py", line 899, in binary_op_wrapper
return func(x, y, name=name)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\ops\math_ops.py", line 1206, in _mul_dispatch
return gen_math_ops.mul(x, y, name=name)

Traceback (most recent call last):
File "ecg/train.py", line 115, in
train(args, params)
File "ecg/train.py", line 92, in train
callbacks=[ts_callback, checkpointer, reduce_lr, stopping])
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\keras\legacy\interfaces.py", line 91, in wrapper
return func(*args, **kwargs)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\keras\engine\training.py", line 2230, in fit_generator
class_weight=class_weight)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\keras\engine\training.py", line 1883, in train_on_batch
outputs = self.train_function(ins)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\keras\backend\tensorflow_backend.py", line 2483, in call
**self.session_kwargs)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\client\session.py", line 956, in run
run_metadata_ptr)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\client\session.py", line 1180, in _run
feed_dict_tensor, options, run_metadata)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\client\session.py", line 1359, in _do_run
run_metadata)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\client\session.py", line 1384, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Incompatible shapes: [32,23,4] vs. [32,69,4]
[[node loss/activation_34_loss/mul (defined at C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\fr
amework\ops.py:1751) ]]

Original stack trace for 'loss/activation_34_loss/mul':

你好,我是有问必答小助手,非常抱歉,本次您提出的有问必答问题,技术专家团超时未为您做出解答

本次提问扣除的有问必答次数,将会以问答VIP体验卡(1次有问必答机会、商城购买实体图书享受95折优惠)的形式为您补发到账户。

​​​​因为有问必答VIP体验卡有效期仅有1天,您在需要使用的时候【私信】联系我,我会为您补发。

您好,您这边主要的问题是: 大概率模型 shape 和数据输入 shape 不匹配