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

我遵循了在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

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

zmmll 回答:使用非符号张量的输入调用了Layer

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

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)
本文链接:https://www.f2er.com/3153485.html

大家都在问