Week 2, Assignment 2: questions about 'pre-trained model'

Hi, I have successfully hacked my way through so far (still need to work on Exercise 3). I learned Python recently in a crash course and still have a weak understanding of object based programming. Thus, I have questions about the loaded pre-trained model and how it is implemented in Tensorflow:

(1) From the pictures below, could you tell me the difference between ‘mobilenet_v2’ (referred to as a “general architecture” on TF site) and ‘MobileNetV2’ (referred to as “Instantiates the MobileNetV2 architecture”) and ‘mobilenet_v2.MobileNetV2’? I’m confused about how ‘MobileNetV2’ is invoked differently in the lower 2 pictures.

Please feel free to re-direct – maybe I should ask on the Tensorflow forum instead?



(2) Below is expected output for the base_model before Exercise 2. I’m confused about the Output Shape after ‘Conv1_pad’ is called. Could the pad be 0.5?

If you’re aware of a great TF tutorial resource, please let me know. Thanks!

Hi yezhang.hydro,

As you can read in the tensorflow documentation here, MobileNet() is a function of the tf.keras.applications module. This is currently the same function as the MobileNet() function in the module mobilenet_v2.

So currently tf.keras.applications.MobileNet() and tf.keras.applications.mobilenet_v2.MobileNet() refers to the same function. tf.keras.mobilenet_v2 is a module that contains other functions such as preprocess_input.

I could speculate about why this is organized as such; you could ask this at the tensorflow forum.

Your second question is answered here.