简体   繁体   English

keras.Model 和 keras.engine.training.Model 有什么区别?

[英]What is difference between keras.Model and keras.engine.training.Model?

I have been trying to prune a keras model post-training.我一直在尝试在训练后修剪 keras 模型。 while doing that, I get model type as NoneType returned.这样做时,我将模型类型作为 NoneType 返回。 While going into the source code of Pruning API, it says the model has to be type keras.Model, but what I am passing has the type keras.engine.training.Model在进入 Pruning API 的源代码时,它说模型必须是 keras.Model 类型,但我传递的是 keras.engine.training.Model 类型

So, is there is any differnece among both?那么,两者之间有什么区别吗?

Both are the exact same class:两者是完全相同的类:

>>> import keras
>>> keras.models.Model
<class 'keras.engine.training.Model'>
>>> keras.Model
<class 'keras.engine.training.Model'>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM