Closed WMeng1 closed 1 year ago
提问时请尽可能提供如下信息:
model = build_transformer_model(config_path, checkpoint_path, model='albert') category = Input(shape=(1,), name='feature_input') categoryEmbedding = Embedding(1, 312)(category) categoryEmbedding = Flatten()(categoryEmbedding)
input = model.input input.append(category)
output = concatenate([model.output, categoryEmbedding], axis=1) output = GlobalPointer(len(categories), 64)(output)
model = Model(input, output)
### 输出信息 ```shell ValueError: A `Concatenate` layer requires inputs with matching shapes except for the concat axis. Got inputs shapes: [(None, None, 312), (None, 312)] 在maxlen维度处要怎么处理才能正确拼接人工构造的特征呢,辛苦您了
不管什么问题,请先尝试自行解决,“万般努力”之下仍然无法解决再来提问。此处请贴上你的努力过程。
提问时请尽可能提供如下信息:
基本信息
核心代码
model = build_transformer_model(config_path, checkpoint_path, model='albert') category = Input(shape=(1,), name='feature_input') categoryEmbedding = Embedding(1, 312)(category) categoryEmbedding = Flatten()(categoryEmbedding)
特征拼接
input = model.input input.append(category)
output = concatenate([model.output, categoryEmbedding], axis=1) output = GlobalPointer(len(categories), 64)(output)
model = Model(input, output)
自我尝试
不管什么问题,请先尝试自行解决,“万般努力”之下仍然无法解决再来提问。此处请贴上你的努力过程。