Layer concatenate_1 was called with an input that isn't a symbolic tensor

问题

如题目所述,编写代码时遇到Layer concatenate_1 was called with an input that isn’t a symbolic tensor的问题,查看 concatenate的对象确实时tensor对象,为什么会有这样的问题呢?

解决方法

查看代码是否 concatenate的参数传错了。注意参数是放在【】里面的,不是 ()。

emb_all = layers.Concatenate(axis=-1)([emb, emb_1])
emb_all = layers.concatenate([emb, emb_1], axis=-1)

猜你喜欢

转载自blog.csdn.net/cyinfi/article/details/92220198