Keras模型输出形状无效错误问题求助
Keras模型输出形状无效错误问题求助
大家好,我正在为自己的强化学习算法搭建Keras模型,但碰到了一个输出形状无效的报错问题,实在搞不定,来求助各位大佬!
下面是我写的build_model函数代码,目前还没写完,但已经出现了形状相关的错误:
def build_model(observation_space, action_space): # Input for possible_position_map matrix possible_position_map_input = Input(shape=observation_space['possible_position_map'].shape, name='possible_position_map_input') # Reshape input data to fit Conv2D format possible_position_map_reshaped = Reshape((100, 1, 1))(possible_position_map_input) # Convolutional layers for processing possible_position_map matrix possible_position_map_conv = Conv2D(filters=16, kernel_size=(3, 1), activation='relu')(possible_position_map_reshaped) possible_position_map_flatten = Flatten()(possible_position_map_conv) # Input for height_map matrix height_map_input = Input(shape=observation_space['height_map'].shape, name='height_map_input') # Reshape input data to ...
我原本打算处理possible_position_map和height_map这两个输入矩阵,后续把它们处理后的特征拼接起来,再连接输出层对应动作空间,但现在刚写到height_map的reshape步骤就触发了输出形状不匹配的错误,有没有朋友能帮我排查下问题所在?
备注:内容来源于stack exchange,提问作者Haras00
相关产品推荐
相关产品推荐

