Closed gitfourteen closed 4 years ago
@gitfourteen, The line you mentioned is one of the functional APIs. Please refer to the documents.
The decorator puts keras modules into kwargs
, and then the function gets keras modules from kwargs
.
@taehoonlee , thanks for your reply. I did not notice at first that the original import is under tensorflow environment:
from tensorflow.keras.applications.inception_v3 import InceptionV3
But still I looked for models.Model(...)
in keras-team/keras in vain.
The reference chain for Model instantiation in tensorflow are like this:
module.Module --> base_layer.Layer --> network.Network --> engine.training.Model --> models.py --> __init__.py --> @keras_modules_injection --> InceptionV3
In InceptionV3, can not figure out why this line can create a model
model = models.Model(inputs, x, name='inception_v3')
and when trace back to this function get_submodules_from_kwargs(kwargs), it ends abruptly without further reference. Would you please advise? thank you!