AttributeError:“顺序"对象在Keras Theano中没有属性"_feed_input_names" [英] AttributeError: 'Sequential' object has no attribute '_feed_input_names' in Keras Theano

查看:80
本文介绍了AttributeError:“顺序"对象在Keras Theano中没有属性"_feed_input_names"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在执行语句时,

hist = model.fit(X_train, Y_train, batch_size=batch_size, epochs=nb_epoch,
               verbose=1, validation_data=(X_test, Y_test))
I'm getting the error,
 File "C:\Users\Parag\Anaconda3\envs\keras_theano\lib\site-packages\keras\engine\training.py", line 737, in _standardize_user_data
    feed_input_names = self._feed_input_names

AttributeError:顺序"对象没有属性'_feed_input_names'

AttributeError: 'Sequential' object has no attribute '_feed_input_names'

推荐答案

尝试将 input_shape 参数添加到网络的第一层.这为我解决了这个问题.

Try adding the input_shape argument to the first layer in your network. This solved the issue for me.

这篇关于AttributeError:“顺序"对象在Keras Theano中没有属性"_feed_input_names"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆