Tensorflow: AttributeError: 'NoneType' object has no attribute 'original_name_scope'

人走茶凉 提交于 2019-12-06 20:28:28

i had the similar issue and the solution is to use

model.add(tf.keras.layers.Dense(128, activation=tf.nn.relu))

instead of

model.add(tf.layers.Dense(128, activation=tf.nn.relu))

answer by @Josh will be required for saving the model.

I had the same issue, and resolved it by setting the input_size parameter in the first layer of the sequential model.

this line: model.add (tf.keras.layers.Flatten())

should be: model.add (tf.keras.layers.Flatten(input_size=(28, 28))

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!