深度阅读

Tensorflow keras构建模型出现This model has not yet been built. Build the model first by calling

作者
作者
2023年08月22日
更新时间
5.99 分钟
阅读时间
0
阅读量

Tensorflow keras构建模型出现如下问题,
在调用model.summary()时候报错

ValueError: This model has not yet been built. Build the model first by calling build() or by calling the model on a batch of data.

错误问题在于:

This model has not yet been built. Build the model first by calling build()
只需要在summary前加上

#加上这句
model.build(input_shape) # `input_shape` is the shape of the input data
                         # e.g. input_shape = (None, 32, 32, 3)
model.summary()

https://stackoverflow.com/questions/55908188/this-model-has-not-yet-been-built-error-on-model-summary

博客作者

热爱技术,乐于分享,持续学习。专注于Web开发、系统架构设计和人工智能领域。