使用非符号张量的输入调用了Layer

时间:2019-11-06 09:37:50

标签: tensorflow keras

我遵循了在this page上找到的代码。

当我复制粘贴代码时,出现错误:

ValueError: Layer batch_normalization_1 was called with an input that isn't a symbolic tensor.

https://github.com/shantanuo/stack_question/blob/master/haptik_chatbot.ipynb

与博客作者不同,我得到错误的原因是什么?

1 个答案:

答案 0 :(得分:1)

似乎您没有在“密集”层中输入内容。

feature_input = Input(shape=(sentences_features.shape[1],))
dense = Dense(128, activation=activations.relu)
merged = BatchNormalization()(dense)

尝试:

dense = Dense(128, activation=activations.relu)(feature_input)