keras LocallyConnected2D 连续建4层(或者更少),就可能会出现模型编译时间超长,狂占GPU显存的问题。原因没有找到。
input = layers.Input(shape = (window_size, factor_num, 1)) model = layers.LocallyConnected2D(8, kernel_size = (1,1))(input) model = layers.BatchNormalization(axis=-1, momentum=momentum)(model) model = layers.Activation("relu")(model) model = layers.LocallyConnected2D(8, kernel_size = (1,1))(model) model = layers.BatchNormalization(axis=-1, momentum=momentum)(model) model = layers.Activation("relu")(model) model = layers.LocallyConnected2D(1, kernel_size = (1,factor_num))(model) model = layers.BatchNormalization(axis=-1, momentum=momentum)(model) model = layers.Activation("relu")(model) model = layers.Reshape((-1,))(model) model = dense(model,32) model = layers.Dense(1)(model) model = Model(inputs = input, outputs = model) model.compile(loss = "mse", optimizer = opt, metrics = [r_square])
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)