最近在使用keras搭建模型的时候出现了这个问题:ValueError: Layer model_3 was called with an input that isn't a symbolic tensor. Received type: <class 'numpy.ndarray'>. Full input:(后边是一个输出的数组,不方便展示了)
将问题定位到代码的136行。这是一个模型引用的位置。出现这个问题的具体原因没有仔细查。但是在这个模型名字的后边加上predict就可以了。
例如:
原来的代码为output = train_model(input)
改为:
output = train_model.predict(input)
这篇文章会持续更新,因为刚学keras,好多原理的东西还没弄懂。等我搞明白了再来说明这么改的原因。