# Setup
Because we switch to `tf2`, instead of using `tf.slim`, we will just use `tf.keras` for the inception model weights.

```python
import tensorflow as tf
tf.__version__
```

    '2.4.1'

```python
import tensorflow.keras as keras
keras.__version__
```

    '2.4.0'

```python
inception_model = keras.applications.inception_v3.InceptionV3()
```

```python
inception_model.summary()
```

    Model: "inception_v3"
    __________________________________________________________________________________________________
    Layer (type)                    Output Shape         Param #     Connected to
    ==================================================================================================
    input_1 (InputLayer)            [(None, 299, 299, 3) 0
    __________________________________________________________________________________________________
    conv2d (Conv2D)                 (None, 149, 149, 32) 864         input_1[0][0]
    __________________________________________________________________________________________________
    batch_normalization (BatchNorma (None, 149, 149, 32) 96          conv2d[0][0]
    __________________________________________________________________________________________________
    activation (Activation)         (None, 149, 149, 32) 0           batch_normalization[0][0]
    __________________________________________________________________________________________________
    conv2d_1 (Conv2D)               (None, 147, 147, 32) 9216        activation[0][0]
    __________________________________________________________________________________________________
    batch_normalization_1 (BatchNor (None, 147, 147, 32) 96          conv2d_1[0][0]
    __________________________________________________________________________________________________
    activation_1 (Activation)       (None, 147, 147, 32) 0           batch_normalization_1[0][0]
    __________________________________________________________________________________________________
    conv2d_2 (Conv2D)               (None, 147, 147, 64) 18432       activation_1[0][0]
    __________________________________________________________________________________________________
    batch_normalization_2 (BatchNor (None, 147, 147, 64) 192         conv2d_2[0][0]
    __________________________________________________________________________________________________
    activation_2 (Activation)       (None, 147, 147, 64) 0           batch_normalization_2[0][0]
    __________________________________________________________________________________________________
    max_pooling2d (MaxPooling2D)    (None, 73, 73, 64)   0           activation_2[0][0]
    __________________________________________________________________________________________________
    conv2d_3 (Conv2D)               (None, 73, 73, 80)   5120        max_pooling2d[0][0]
    __________________________________________________________________________________________________
    batch_normalization_3 (BatchNor (None, 73, 73, 80)   240         conv2d_3[0][0]
    __________________________________________________________________________________________________
    activation_3 (Activation)       (None, 73, 73, 80)   0           batch_normalization_3[0][0]
    __________________________________________________________________________________________________
    conv2d_4 (Conv2D)               (None, 71, 71, 192)  138240      activation_3[0][0]
    __________________________________________________________________________________________________
    batch_normalization_4 (BatchNor (None, 71, 71, 192)  576         conv2d_4[0][0]
    __________________________________________________________________________________________________
    activation_4 (Activation)       (None, 71, 71, 192)  0           batch_normalization_4[0][0]
    __________________________________________________________________________________________________
    max_pooling2d_1 (MaxPooling2D)  (None, 35, 35, 192)  0           activation_4[0][0]
    __________________________________________________________________________________________________
    conv2d_8 (Conv2D)               (None, 35, 35, 64)   12288       max_pooling2d_1[0][0]
    __________________________________________________________________________________________________
    batch_normalization_8 (BatchNor (None, 35, 35, 64)   192         conv2d_8[0][0]
    __________________________________________________________________________________________________
    activation_8 (Activation)       (None, 35, 35, 64)   0           batch_normalization_8[0][0]
    __________________________________________________________________________________________________
    conv2d_6 (Conv2D)               (None, 35, 35, 48)   9216        max_pooling2d_1[0][0]
    __________________________________________________________________________________________________
    conv2d_9 (Conv2D)               (None, 35, 35, 96)   55296       activation_8[0][0]
    __________________________________________________________________________________________________
    batch_normalization_6 (BatchNor (None, 35, 35, 48)   144         conv2d_6[0][0]
    __________________________________________________________________________________________________
    batch_normalization_9 (BatchNor (None, 35, 35, 96)   288         conv2d_9[0][0]
    __________________________________________________________________________________________________
    activation_6 (Activation)       (None, 35, 35, 48)   0           batch_normalization_6[0][0]
    __________________________________________________________________________________________________
    activation_9 (Activation)       (None, 35, 35, 96)   0           batch_normalization_9[0][0]
    __________________________________________________________________________________________________
    average_pooling2d (AveragePooli (None, 35, 35, 192)  0           max_pooling2d_1[0][0]
    __________________________________________________________________________________________________
    conv2d_5 (Conv2D)               (None, 35, 35, 64)   12288       max_pooling2d_1[0][0]
    __________________________________________________________________________________________________
    conv2d_7 (Conv2D)               (None, 35, 35, 64)   76800       activation_6[0][0]
    __________________________________________________________________________________________________
    conv2d_10 (Conv2D)              (None, 35, 35, 96)   82944       activation_9[0][0]
    __________________________________________________________________________________________________
    conv2d_11 (Conv2D)              (None, 35, 35, 32)   6144        average_pooling2d[0][0]
    __________________________________________________________________________________________________
    batch_normalization_5 (BatchNor (None, 35, 35, 64)   192         conv2d_5[0][0]
    __________________________________________________________________________________________________
    batch_normalization_7 (BatchNor (None, 35, 35, 64)   192         conv2d_7[0][0]
    __________________________________________________________________________________________________
    batch_normalization_10 (BatchNo (None, 35, 35, 96)   288         conv2d_10[0][0]
    __________________________________________________________________________________________________
    batch_normalization_11 (BatchNo (None, 35, 35, 32)   96          conv2d_11[0][0]
    __________________________________________________________________________________________________
    activation_5 (Activation)       (None, 35, 35, 64)   0           batch_normalization_5[0][0]
    __________________________________________________________________________________________________
    activation_7 (Activation)       (None, 35, 35, 64)   0           batch_normalization_7[0][0]
    __________________________________________________________________________________________________
    activation_10 (Activation)      (None, 35, 35, 96)   0           batch_normalization_10[0][0]
    __________________________________________________________________________________________________
    activation_11 (Activation)      (None, 35, 35, 32)   0           batch_normalization_11[0][0]
    __________________________________________________________________________________________________
    mixed0 (Concatenate)            (None, 35, 35, 256)  0           activation_5[0][0]
                                                                     activation_7[0][0]
                                                                     activation_10[0][0]
                                                                     activation_11[0][0]
    __________________________________________________________________________________________________
    conv2d_15 (Conv2D)              (None, 35, 35, 64)   16384       mixed0[0][0]
    __________________________________________________________________________________________________
    batch_normalization_15 (BatchNo (None, 35, 35, 64)   192         conv2d_15[0][0]
    __________________________________________________________________________________________________
    activation_15 (Activation)      (None, 35, 35, 64)   0           batch_normalization_15[0][0]
    __________________________________________________________________________________________________
    conv2d_13 (Conv2D)              (None, 35, 35, 48)   12288       mixed0[0][0]
    __________________________________________________________________________________________________
    conv2d_16 (Conv2D)              (None, 35, 35, 96)   55296       activation_15[0][0]
    __________________________________________________________________________________________________
    batch_normalization_13 (BatchNo (None, 35, 35, 48)   144         conv2d_13[0][0]
    __________________________________________________________________________________________________
    batch_normalization_16 (BatchNo (None, 35, 35, 96)   288         conv2d_16[0][0]
    __________________________________________________________________________________________________
    activation_13 (Activation)      (None, 35, 35, 48)   0           batch_normalization_13[0][0]
    __________________________________________________________________________________________________
    activation_16 (Activation)      (None, 35, 35, 96)   0           batch_normalization_16[0][0]
    __________________________________________________________________________________________________
    average_pooling2d_1 (AveragePoo (None, 35, 35, 256)  0           mixed0[0][0]
    __________________________________________________________________________________________________
    conv2d_12 (Conv2D)              (None, 35, 35, 64)   16384       mixed0[0][0]
    __________________________________________________________________________________________________
    conv2d_14 (Conv2D)              (None, 35, 35, 64)   76800       activation_13[0][0]
    __________________________________________________________________________________________________
    conv2d_17 (Conv2D)              (None, 35, 35, 96)   82944       activation_16[0][0]
    __________________________________________________________________________________________________
    conv2d_18 (Conv2D)              (None, 35, 35, 64)   16384       average_pooling2d_1[0][0]
    __________________________________________________________________________________________________
    batch_normalization_12 (BatchNo (None, 35, 35, 64)   192         conv2d_12[0][0]
    __________________________________________________________________________________________________
    batch_normalization_14 (BatchNo (None, 35, 35, 64)   192         conv2d_14[0][0]
    __________________________________________________________________________________________________
    batch_normalization_17 (BatchNo (None, 35, 35, 96)   288         conv2d_17[0][0]
    __________________________________________________________________________________________________
    batch_normalization_18 (BatchNo (None, 35, 35, 64)   192         conv2d_18[0][0]
    __________________________________________________________________________________________________
    activation_12 (Activation)      (None, 35, 35, 64)   0           batch_normalization_12[0][0]
    __________________________________________________________________________________________________
    activation_14 (Activation)      (None, 35, 35, 64)   0           batch_normalization_14[0][0]
    __________________________________________________________________________________________________
    activation_17 (Activation)      (None, 35, 35, 96)   0           batch_normalization_17[0][0]
    __________________________________________________________________________________________________
    activation_18 (Activation)      (None, 35, 35, 64)   0           batch_normalization_18[0][0]
    __________________________________________________________________________________________________
    mixed1 (Concatenate)            (None, 35, 35, 288)  0           activation_12[0][0]
                                                                     activation_14[0][0]
                                                                     activation_17[0][0]
                                                                     activation_18[0][0]
    __________________________________________________________________________________________________
    conv2d_22 (Conv2D)              (None, 35, 35, 64)   18432       mixed1[0][0]
    __________________________________________________________________________________________________
    batch_normalization_22 (BatchNo (None, 35, 35, 64)   192         conv2d_22[0][0]
    __________________________________________________________________________________________________
    activation_22 (Activation)      (None, 35, 35, 64)   0           batch_normalization_22[0][0]
    __________________________________________________________________________________________________
    conv2d_20 (Conv2D)              (None, 35, 35, 48)   13824       mixed1[0][0]
    __________________________________________________________________________________________________
    conv2d_23 (Conv2D)              (None, 35, 35, 96)   55296       activation_22[0][0]
    __________________________________________________________________________________________________
    batch_normalization_20 (BatchNo (None, 35, 35, 48)   144         conv2d_20[0][0]
    __________________________________________________________________________________________________
    batch_normalization_23 (BatchNo (None, 35, 35, 96)   288         conv2d_23[0][0]
    __________________________________________________________________________________________________
    activation_20 (Activation)      (None, 35, 35, 48)   0           batch_normalization_20[0][0]
    __________________________________________________________________________________________________
    activation_23 (Activation)      (None, 35, 35, 96)   0           batch_normalization_23[0][0]
    __________________________________________________________________________________________________
    average_pooling2d_2 (AveragePoo (None, 35, 35, 288)  0           mixed1[0][0]
    __________________________________________________________________________________________________
    conv2d_19 (Conv2D)              (None, 35, 35, 64)   18432       mixed1[0][0]
    __________________________________________________________________________________________________
    conv2d_21 (Conv2D)              (None, 35, 35, 64)   76800       activation_20[0][0]
    __________________________________________________________________________________________________
    conv2d_24 (Conv2D)              (None, 35, 35, 96)   82944       activation_23[0][0]
    __________________________________________________________________________________________________
    conv2d_25 (Conv2D)              (None, 35, 35, 64)   18432       average_pooling2d_2[0][0]
    __________________________________________________________________________________________________
    batch_normalization_19 (BatchNo (None, 35, 35, 64)   192         conv2d_19[0][0]
    __________________________________________________________________________________________________
    batch_normalization_21 (BatchNo (None, 35, 35, 64)   192         conv2d_21[0][0]
    __________________________________________________________________________________________________
    batch_normalization_24 (BatchNo (None, 35, 35, 96)   288         conv2d_24[0][0]
    __________________________________________________________________________________________________
    batch_normalization_25 (BatchNo (None, 35, 35, 64)   192         conv2d_25[0][0]
    __________________________________________________________________________________________________
    activation_19 (Activation)      (None, 35, 35, 64)   0           batch_normalization_19[0][0]
    __________________________________________________________________________________________________
    activation_21 (Activation)      (None, 35, 35, 64)   0           batch_normalization_21[0][0]
    __________________________________________________________________________________________________
    activation_24 (Activation)      (None, 35, 35, 96)   0           batch_normalization_24[0][0]
    __________________________________________________________________________________________________
    activation_25 (Activation)      (None, 35, 35, 64)   0           batch_normalization_25[0][0]
    __________________________________________________________________________________________________
    mixed2 (Concatenate)            (None, 35, 35, 288)  0           activation_19[0][0]
                                                                     activation_21[0][0]
                                                                     activation_24[0][0]
                                                                     activation_25[0][0]
    __________________________________________________________________________________________________
    conv2d_27 (Conv2D)              (None, 35, 35, 64)   18432       mixed2[0][0]
    __________________________________________________________________________________________________
    batch_normalization_27 (BatchNo (None, 35, 35, 64)   192         conv2d_27[0][0]
    __________________________________________________________________________________________________
    activation_27 (Activation)      (None, 35, 35, 64)   0           batch_normalization_27[0][0]
    __________________________________________________________________________________________________
    conv2d_28 (Conv2D)              (None, 35, 35, 96)   55296       activation_27[0][0]
    __________________________________________________________________________________________________
    batch_normalization_28 (BatchNo (None, 35, 35, 96)   288         conv2d_28[0][0]
    __________________________________________________________________________________________________
    activation_28 (Activation)      (None, 35, 35, 96)   0           batch_normalization_28[0][0]
    __________________________________________________________________________________________________
    conv2d_26 (Conv2D)              (None, 17, 17, 384)  995328      mixed2[0][0]
    __________________________________________________________________________________________________
    conv2d_29 (Conv2D)              (None, 17, 17, 96)   82944       activation_28[0][0]
    __________________________________________________________________________________________________
    batch_normalization_26 (BatchNo (None, 17, 17, 384)  1152        conv2d_26[0][0]
    __________________________________________________________________________________________________
    batch_normalization_29 (BatchNo (None, 17, 17, 96)   288         conv2d_29[0][0]
    __________________________________________________________________________________________________
    activation_26 (Activation)      (None, 17, 17, 384)  0           batch_normalization_26[0][0]
    __________________________________________________________________________________________________
    activation_29 (Activation)      (None, 17, 17, 96)   0           batch_normalization_29[0][0]
    __________________________________________________________________________________________________
    max_pooling2d_2 (MaxPooling2D)  (None, 17, 17, 288)  0           mixed2[0][0]
    __________________________________________________________________________________________________
    mixed3 (Concatenate)            (None, 17, 17, 768)  0           activation_26[0][0]
                                                                     activation_29[0][0]
                                                                     max_pooling2d_2[0][0]
    __________________________________________________________________________________________________
    conv2d_34 (Conv2D)              (None, 17, 17, 128)  98304       mixed3[0][0]
    __________________________________________________________________________________________________
    batch_normalization_34 (BatchNo (None, 17, 17, 128)  384         conv2d_34[0][0]
    __________________________________________________________________________________________________
    activation_34 (Activation)      (None, 17, 17, 128)  0           batch_normalization_34[0][0]
    __________________________________________________________________________________________________
    conv2d_35 (Conv2D)              (None, 17, 17, 128)  114688      activation_34[0][0]
    __________________________________________________________________________________________________
    batch_normalization_35 (BatchNo (None, 17, 17, 128)  384         conv2d_35[0][0]
    __________________________________________________________________________________________________
    activation_35 (Activation)      (None, 17, 17, 128)  0           batch_normalization_35[0][0]
    __________________________________________________________________________________________________
    conv2d_31 (Conv2D)              (None, 17, 17, 128)  98304       mixed3[0][0]
    __________________________________________________________________________________________________
    conv2d_36 (Conv2D)              (None, 17, 17, 128)  114688      activation_35[0][0]
    __________________________________________________________________________________________________
    batch_normalization_31 (BatchNo (None, 17, 17, 128)  384         conv2d_31[0][0]
    __________________________________________________________________________________________________
    batch_normalization_36 (BatchNo (None, 17, 17, 128)  384         conv2d_36[0][0]
    __________________________________________________________________________________________________
    activation_31 (Activation)      (None, 17, 17, 128)  0           batch_normalization_31[0][0]
    __________________________________________________________________________________________________
    activation_36 (Activation)      (None, 17, 17, 128)  0           batch_normalization_36[0][0]
    __________________________________________________________________________________________________
    conv2d_32 (Conv2D)              (None, 17, 17, 128)  114688      activation_31[0][0]
    __________________________________________________________________________________________________
    conv2d_37 (Conv2D)              (None, 17, 17, 128)  114688      activation_36[0][0]
    __________________________________________________________________________________________________
    batch_normalization_32 (BatchNo (None, 17, 17, 128)  384         conv2d_32[0][0]
    __________________________________________________________________________________________________
    batch_normalization_37 (BatchNo (None, 17, 17, 128)  384         conv2d_37[0][0]
    __________________________________________________________________________________________________
    activation_32 (Activation)      (None, 17, 17, 128)  0           batch_normalization_32[0][0]
    __________________________________________________________________________________________________
    activation_37 (Activation)      (None, 17, 17, 128)  0           batch_normalization_37[0][0]
    __________________________________________________________________________________________________
    average_pooling2d_3 (AveragePoo (None, 17, 17, 768)  0           mixed3[0][0]
    __________________________________________________________________________________________________
    conv2d_30 (Conv2D)              (None, 17, 17, 192)  147456      mixed3[0][0]
    __________________________________________________________________________________________________
    conv2d_33 (Conv2D)              (None, 17, 17, 192)  172032      activation_32[0][0]
    __________________________________________________________________________________________________
    conv2d_38 (Conv2D)              (None, 17, 17, 192)  172032      activation_37[0][0]
    __________________________________________________________________________________________________
    conv2d_39 (Conv2D)              (None, 17, 17, 192)  147456      average_pooling2d_3[0][0]
    __________________________________________________________________________________________________
    batch_normalization_30 (BatchNo (None, 17, 17, 192)  576         conv2d_30[0][0]
    __________________________________________________________________________________________________
    batch_normalization_33 (BatchNo (None, 17, 17, 192)  576         conv2d_33[0][0]
    __________________________________________________________________________________________________
    batch_normalization_38 (BatchNo (None, 17, 17, 192)  576         conv2d_38[0][0]
    __________________________________________________________________________________________________
    batch_normalization_39 (BatchNo (None, 17, 17, 192)  576         conv2d_39[0][0]
    __________________________________________________________________________________________________
    activation_30 (Activation)      (None, 17, 17, 192)  0           batch_normalization_30[0][0]
    __________________________________________________________________________________________________
    activation_33 (Activation)      (None, 17, 17, 192)  0           batch_normalization_33[0][0]
    __________________________________________________________________________________________________
    activation_38 (Activation)      (None, 17, 17, 192)  0           batch_normalization_38[0][0]
    __________________________________________________________________________________________________
    activation_39 (Activation)      (None, 17, 17, 192)  0           batch_normalization_39[0][0]
    __________________________________________________________________________________________________
    mixed4 (Concatenate)            (None, 17, 17, 768)  0           activation_30[0][0]
                                                                     activation_33[0][0]
                                                                     activation_38[0][0]
                                                                     activation_39[0][0]
    __________________________________________________________________________________________________
    conv2d_44 (Conv2D)              (None, 17, 17, 160)  122880      mixed4[0][0]
    __________________________________________________________________________________________________
    batch_normalization_44 (BatchNo (None, 17, 17, 160)  480         conv2d_44[0][0]
    __________________________________________________________________________________________________
    activation_44 (Activation)      (None, 17, 17, 160)  0           batch_normalization_44[0][0]
    __________________________________________________________________________________________________
    conv2d_45 (Conv2D)              (None, 17, 17, 160)  179200      activation_44[0][0]
    __________________________________________________________________________________________________
    batch_normalization_45 (BatchNo (None, 17, 17, 160)  480         conv2d_45[0][0]
    __________________________________________________________________________________________________
    activation_45 (Activation)      (None, 17, 17, 160)  0           batch_normalization_45[0][0]
    __________________________________________________________________________________________________
    conv2d_41 (Conv2D)              (None, 17, 17, 160)  122880      mixed4[0][0]
    __________________________________________________________________________________________________
    conv2d_46 (Conv2D)              (None, 17, 17, 160)  179200      activation_45[0][0]
    __________________________________________________________________________________________________
    batch_normalization_41 (BatchNo (None, 17, 17, 160)  480         conv2d_41[0][0]
    __________________________________________________________________________________________________
    batch_normalization_46 (BatchNo (None, 17, 17, 160)  480         conv2d_46[0][0]
    __________________________________________________________________________________________________
    activation_41 (Activation)      (None, 17, 17, 160)  0           batch_normalization_41[0][0]
    __________________________________________________________________________________________________
    activation_46 (Activation)      (None, 17, 17, 160)  0           batch_normalization_46[0][0]
    __________________________________________________________________________________________________
    conv2d_42 (Conv2D)              (None, 17, 17, 160)  179200      activation_41[0][0]
    __________________________________________________________________________________________________
    conv2d_47 (Conv2D)              (None, 17, 17, 160)  179200      activation_46[0][0]
    __________________________________________________________________________________________________
    batch_normalization_42 (BatchNo (None, 17, 17, 160)  480         conv2d_42[0][0]
    __________________________________________________________________________________________________
    batch_normalization_47 (BatchNo (None, 17, 17, 160)  480         conv2d_47[0][0]
    __________________________________________________________________________________________________
    activation_42 (Activation)      (None, 17, 17, 160)  0           batch_normalization_42[0][0]
    __________________________________________________________________________________________________
    activation_47 (Activation)      (None, 17, 17, 160)  0           batch_normalization_47[0][0]
    __________________________________________________________________________________________________
    average_pooling2d_4 (AveragePoo (None, 17, 17, 768)  0           mixed4[0][0]
    __________________________________________________________________________________________________
    conv2d_40 (Conv2D)              (None, 17, 17, 192)  147456      mixed4[0][0]
    __________________________________________________________________________________________________
    conv2d_43 (Conv2D)              (None, 17, 17, 192)  215040      activation_42[0][0]
    __________________________________________________________________________________________________
    conv2d_48 (Conv2D)              (None, 17, 17, 192)  215040      activation_47[0][0]
    __________________________________________________________________________________________________
    conv2d_49 (Conv2D)              (None, 17, 17, 192)  147456      average_pooling2d_4[0][0]
    __________________________________________________________________________________________________
    batch_normalization_40 (BatchNo (None, 17, 17, 192)  576         conv2d_40[0][0]
    __________________________________________________________________________________________________
    batch_normalization_43 (BatchNo (None, 17, 17, 192)  576         conv2d_43[0][0]
    __________________________________________________________________________________________________
    batch_normalization_48 (BatchNo (None, 17, 17, 192)  576         conv2d_48[0][0]
    __________________________________________________________________________________________________
    batch_normalization_49 (BatchNo (None, 17, 17, 192)  576         conv2d_49[0][0]
    __________________________________________________________________________________________________
    activation_40 (Activation)      (None, 17, 17, 192)  0           batch_normalization_40[0][0]
    __________________________________________________________________________________________________
    activation_43 (Activation)      (None, 17, 17, 192)  0           batch_normalization_43[0][0]
    __________________________________________________________________________________________________
    activation_48 (Activation)      (None, 17, 17, 192)  0           batch_normalization_48[0][0]
    __________________________________________________________________________________________________
    activation_49 (Activation)      (None, 17, 17, 192)  0           batch_normalization_49[0][0]
    __________________________________________________________________________________________________
    mixed5 (Concatenate)            (None, 17, 17, 768)  0           activation_40[0][0]
                                                                     activation_43[0][0]
                                                                     activation_48[0][0]
                                                                     activation_49[0][0]
    __________________________________________________________________________________________________
    conv2d_54 (Conv2D)              (None, 17, 17, 160)  122880      mixed5[0][0]
    __________________________________________________________________________________________________
    batch_normalization_54 (BatchNo (None, 17, 17, 160)  480         conv2d_54[0][0]
    __________________________________________________________________________________________________
    activation_54 (Activation)      (None, 17, 17, 160)  0           batch_normalization_54[0][0]
    __________________________________________________________________________________________________
    conv2d_55 (Conv2D)              (None, 17, 17, 160)  179200      activation_54[0][0]
    __________________________________________________________________________________________________
    batch_normalization_55 (BatchNo (None, 17, 17, 160)  480         conv2d_55[0][0]
    __________________________________________________________________________________________________
    activation_55 (Activation)      (None, 17, 17, 160)  0           batch_normalization_55[0][0]
    __________________________________________________________________________________________________
    conv2d_51 (Conv2D)              (None, 17, 17, 160)  122880      mixed5[0][0]
    __________________________________________________________________________________________________
    conv2d_56 (Conv2D)              (None, 17, 17, 160)  179200      activation_55[0][0]
    __________________________________________________________________________________________________
    batch_normalization_51 (BatchNo (None, 17, 17, 160)  480         conv2d_51[0][0]
    __________________________________________________________________________________________________
    batch_normalization_56 (BatchNo (None, 17, 17, 160)  480         conv2d_56[0][0]
    __________________________________________________________________________________________________
    activation_51 (Activation)      (None, 17, 17, 160)  0           batch_normalization_51[0][0]
    __________________________________________________________________________________________________
    activation_56 (Activation)      (None, 17, 17, 160)  0           batch_normalization_56[0][0]
    __________________________________________________________________________________________________
    conv2d_52 (Conv2D)              (None, 17, 17, 160)  179200      activation_51[0][0]
    __________________________________________________________________________________________________
    conv2d_57 (Conv2D)              (None, 17, 17, 160)  179200      activation_56[0][0]
    __________________________________________________________________________________________________
    batch_normalization_52 (BatchNo (None, 17, 17, 160)  480         conv2d_52[0][0]
    __________________________________________________________________________________________________
    batch_normalization_57 (BatchNo (None, 17, 17, 160)  480         conv2d_57[0][0]
    __________________________________________________________________________________________________
    activation_52 (Activation)      (None, 17, 17, 160)  0           batch_normalization_52[0][0]
    __________________________________________________________________________________________________
    activation_57 (Activation)      (None, 17, 17, 160)  0           batch_normalization_57[0][0]
    __________________________________________________________________________________________________
    average_pooling2d_5 (AveragePoo (None, 17, 17, 768)  0           mixed5[0][0]
    __________________________________________________________________________________________________
    conv2d_50 (Conv2D)              (None, 17, 17, 192)  147456      mixed5[0][0]
    __________________________________________________________________________________________________
    conv2d_53 (Conv2D)              (None, 17, 17, 192)  215040      activation_52[0][0]
    __________________________________________________________________________________________________
    conv2d_58 (Conv2D)              (None, 17, 17, 192)  215040      activation_57[0][0]
    __________________________________________________________________________________________________
    conv2d_59 (Conv2D)              (None, 17, 17, 192)  147456      average_pooling2d_5[0][0]
    __________________________________________________________________________________________________
    batch_normalization_50 (BatchNo (None, 17, 17, 192)  576         conv2d_50[0][0]
    __________________________________________________________________________________________________
    batch_normalization_53 (BatchNo (None, 17, 17, 192)  576         conv2d_53[0][0]
    __________________________________________________________________________________________________
    batch_normalization_58 (BatchNo (None, 17, 17, 192)  576         conv2d_58[0][0]
    __________________________________________________________________________________________________
    batch_normalization_59 (BatchNo (None, 17, 17, 192)  576         conv2d_59[0][0]
    __________________________________________________________________________________________________
    activation_50 (Activation)      (None, 17, 17, 192)  0           batch_normalization_50[0][0]
    __________________________________________________________________________________________________
    activation_53 (Activation)      (None, 17, 17, 192)  0           batch_normalization_53[0][0]
    __________________________________________________________________________________________________
    activation_58 (Activation)      (None, 17, 17, 192)  0           batch_normalization_58[0][0]
    __________________________________________________________________________________________________
    activation_59 (Activation)      (None, 17, 17, 192)  0           batch_normalization_59[0][0]
    __________________________________________________________________________________________________
    mixed6 (Concatenate)            (None, 17, 17, 768)  0           activation_50[0][0]
                                                                     activation_53[0][0]
                                                                     activation_58[0][0]
                                                                     activation_59[0][0]
    __________________________________________________________________________________________________
    conv2d_64 (Conv2D)              (None, 17, 17, 192)  147456      mixed6[0][0]
    __________________________________________________________________________________________________
    batch_normalization_64 (BatchNo (None, 17, 17, 192)  576         conv2d_64[0][0]
    __________________________________________________________________________________________________
    activation_64 (Activation)      (None, 17, 17, 192)  0           batch_normalization_64[0][0]
    __________________________________________________________________________________________________
    conv2d_65 (Conv2D)              (None, 17, 17, 192)  258048      activation_64[0][0]
    __________________________________________________________________________________________________
    batch_normalization_65 (BatchNo (None, 17, 17, 192)  576         conv2d_65[0][0]
    __________________________________________________________________________________________________
    activation_65 (Activation)      (None, 17, 17, 192)  0           batch_normalization_65[0][0]
    __________________________________________________________________________________________________
    conv2d_61 (Conv2D)              (None, 17, 17, 192)  147456      mixed6[0][0]
    __________________________________________________________________________________________________
    conv2d_66 (Conv2D)              (None, 17, 17, 192)  258048      activation_65[0][0]
    __________________________________________________________________________________________________
    batch_normalization_61 (BatchNo (None, 17, 17, 192)  576         conv2d_61[0][0]
    __________________________________________________________________________________________________
    batch_normalization_66 (BatchNo (None, 17, 17, 192)  576         conv2d_66[0][0]
    __________________________________________________________________________________________________
    activation_61 (Activation)      (None, 17, 17, 192)  0           batch_normalization_61[0][0]
    __________________________________________________________________________________________________
    activation_66 (Activation)      (None, 17, 17, 192)  0           batch_normalization_66[0][0]
    __________________________________________________________________________________________________
    conv2d_62 (Conv2D)              (None, 17, 17, 192)  258048      activation_61[0][0]
    __________________________________________________________________________________________________
    conv2d_67 (Conv2D)              (None, 17, 17, 192)  258048      activation_66[0][0]
    __________________________________________________________________________________________________
    batch_normalization_62 (BatchNo (None, 17, 17, 192)  576         conv2d_62[0][0]
    __________________________________________________________________________________________________
    batch_normalization_67 (BatchNo (None, 17, 17, 192)  576         conv2d_67[0][0]
    __________________________________________________________________________________________________
    activation_62 (Activation)      (None, 17, 17, 192)  0           batch_normalization_62[0][0]
    __________________________________________________________________________________________________
    activation_67 (Activation)      (None, 17, 17, 192)  0           batch_normalization_67[0][0]
    __________________________________________________________________________________________________
    average_pooling2d_6 (AveragePoo (None, 17, 17, 768)  0           mixed6[0][0]
    __________________________________________________________________________________________________
    conv2d_60 (Conv2D)              (None, 17, 17, 192)  147456      mixed6[0][0]
    __________________________________________________________________________________________________
    conv2d_63 (Conv2D)              (None, 17, 17, 192)  258048      activation_62[0][0]
    __________________________________________________________________________________________________
    conv2d_68 (Conv2D)              (None, 17, 17, 192)  258048      activation_67[0][0]
    __________________________________________________________________________________________________
    conv2d_69 (Conv2D)              (None, 17, 17, 192)  147456      average_pooling2d_6[0][0]
    __________________________________________________________________________________________________
    batch_normalization_60 (BatchNo (None, 17, 17, 192)  576         conv2d_60[0][0]
    __________________________________________________________________________________________________
    batch_normalization_63 (BatchNo (None, 17, 17, 192)  576         conv2d_63[0][0]
    __________________________________________________________________________________________________
    batch_normalization_68 (BatchNo (None, 17, 17, 192)  576         conv2d_68[0][0]
    __________________________________________________________________________________________________
    batch_normalization_69 (BatchNo (None, 17, 17, 192)  576         conv2d_69[0][0]
    __________________________________________________________________________________________________
    activation_60 (Activation)      (None, 17, 17, 192)  0           batch_normalization_60[0][0]
    __________________________________________________________________________________________________
    activation_63 (Activation)      (None, 17, 17, 192)  0           batch_normalization_63[0][0]
    __________________________________________________________________________________________________
    activation_68 (Activation)      (None, 17, 17, 192)  0           batch_normalization_68[0][0]
    __________________________________________________________________________________________________
    activation_69 (Activation)      (None, 17, 17, 192)  0           batch_normalization_69[0][0]
    __________________________________________________________________________________________________
    mixed7 (Concatenate)            (None, 17, 17, 768)  0           activation_60[0][0]
                                                                     activation_63[0][0]
                                                                     activation_68[0][0]
                                                                     activation_69[0][0]
    __________________________________________________________________________________________________
    conv2d_72 (Conv2D)              (None, 17, 17, 192)  147456      mixed7[0][0]
    __________________________________________________________________________________________________
    batch_normalization_72 (BatchNo (None, 17, 17, 192)  576         conv2d_72[0][0]
    __________________________________________________________________________________________________
    activation_72 (Activation)      (None, 17, 17, 192)  0           batch_normalization_72[0][0]
    __________________________________________________________________________________________________
    conv2d_73 (Conv2D)              (None, 17, 17, 192)  258048      activation_72[0][0]
    __________________________________________________________________________________________________
    batch_normalization_73 (BatchNo (None, 17, 17, 192)  576         conv2d_73[0][0]
    __________________________________________________________________________________________________
    activation_73 (Activation)      (None, 17, 17, 192)  0           batch_normalization_73[0][0]
    __________________________________________________________________________________________________
    conv2d_70 (Conv2D)              (None, 17, 17, 192)  147456      mixed7[0][0]
    __________________________________________________________________________________________________
    conv2d_74 (Conv2D)              (None, 17, 17, 192)  258048      activation_73[0][0]
    __________________________________________________________________________________________________
    batch_normalization_70 (BatchNo (None, 17, 17, 192)  576         conv2d_70[0][0]
    __________________________________________________________________________________________________
    batch_normalization_74 (BatchNo (None, 17, 17, 192)  576         conv2d_74[0][0]
    __________________________________________________________________________________________________
    activation_70 (Activation)      (None, 17, 17, 192)  0           batch_normalization_70[0][0]
    __________________________________________________________________________________________________
    activation_74 (Activation)      (None, 17, 17, 192)  0           batch_normalization_74[0][0]
    __________________________________________________________________________________________________
    conv2d_71 (Conv2D)              (None, 8, 8, 320)    552960      activation_70[0][0]
    __________________________________________________________________________________________________
    conv2d_75 (Conv2D)              (None, 8, 8, 192)    331776      activation_74[0][0]
    __________________________________________________________________________________________________
    batch_normalization_71 (BatchNo (None, 8, 8, 320)    960         conv2d_71[0][0]
    __________________________________________________________________________________________________
    batch_normalization_75 (BatchNo (None, 8, 8, 192)    576         conv2d_75[0][0]
    __________________________________________________________________________________________________
    activation_71 (Activation)      (None, 8, 8, 320)    0           batch_normalization_71[0][0]
    __________________________________________________________________________________________________
    activation_75 (Activation)      (None, 8, 8, 192)    0           batch_normalization_75[0][0]
    __________________________________________________________________________________________________
    max_pooling2d_3 (MaxPooling2D)  (None, 8, 8, 768)    0           mixed7[0][0]
    __________________________________________________________________________________________________
    mixed8 (Concatenate)            (None, 8, 8, 1280)   0           activation_71[0][0]
                                                                     activation_75[0][0]
                                                                     max_pooling2d_3[0][0]
    __________________________________________________________________________________________________
    conv2d_80 (Conv2D)              (None, 8, 8, 448)    573440      mixed8[0][0]
    __________________________________________________________________________________________________
    batch_normalization_80 (BatchNo (None, 8, 8, 448)    1344        conv2d_80[0][0]
    __________________________________________________________________________________________________
    activation_80 (Activation)      (None, 8, 8, 448)    0           batch_normalization_80[0][0]
    __________________________________________________________________________________________________
    conv2d_77 (Conv2D)              (None, 8, 8, 384)    491520      mixed8[0][0]
    __________________________________________________________________________________________________
    conv2d_81 (Conv2D)              (None, 8, 8, 384)    1548288     activation_80[0][0]
    __________________________________________________________________________________________________
    batch_normalization_77 (BatchNo (None, 8, 8, 384)    1152        conv2d_77[0][0]
    __________________________________________________________________________________________________
    batch_normalization_81 (BatchNo (None, 8, 8, 384)    1152        conv2d_81[0][0]
    __________________________________________________________________________________________________
    activation_77 (Activation)      (None, 8, 8, 384)    0           batch_normalization_77[0][0]
    __________________________________________________________________________________________________
    activation_81 (Activation)      (None, 8, 8, 384)    0           batch_normalization_81[0][0]
    __________________________________________________________________________________________________
    conv2d_78 (Conv2D)              (None, 8, 8, 384)    442368      activation_77[0][0]
    __________________________________________________________________________________________________
    conv2d_79 (Conv2D)              (None, 8, 8, 384)    442368      activation_77[0][0]
    __________________________________________________________________________________________________
    conv2d_82 (Conv2D)              (None, 8, 8, 384)    442368      activation_81[0][0]
    __________________________________________________________________________________________________
    conv2d_83 (Conv2D)              (None, 8, 8, 384)    442368      activation_81[0][0]
    __________________________________________________________________________________________________
    average_pooling2d_7 (AveragePoo (None, 8, 8, 1280)   0           mixed8[0][0]
    __________________________________________________________________________________________________
    conv2d_76 (Conv2D)              (None, 8, 8, 320)    409600      mixed8[0][0]
    __________________________________________________________________________________________________
    batch_normalization_78 (BatchNo (None, 8, 8, 384)    1152        conv2d_78[0][0]
    __________________________________________________________________________________________________
    batch_normalization_79 (BatchNo (None, 8, 8, 384)    1152        conv2d_79[0][0]
    __________________________________________________________________________________________________
    batch_normalization_82 (BatchNo (None, 8, 8, 384)    1152        conv2d_82[0][0]
    __________________________________________________________________________________________________
    batch_normalization_83 (BatchNo (None, 8, 8, 384)    1152        conv2d_83[0][0]
    __________________________________________________________________________________________________
    conv2d_84 (Conv2D)              (None, 8, 8, 192)    245760      average_pooling2d_7[0][0]
    __________________________________________________________________________________________________
    batch_normalization_76 (BatchNo (None, 8, 8, 320)    960         conv2d_76[0][0]
    __________________________________________________________________________________________________
    activation_78 (Activation)      (None, 8, 8, 384)    0           batch_normalization_78[0][0]
    __________________________________________________________________________________________________
    activation_79 (Activation)      (None, 8, 8, 384)    0           batch_normalization_79[0][0]
    __________________________________________________________________________________________________
    activation_82 (Activation)      (None, 8, 8, 384)    0           batch_normalization_82[0][0]
    __________________________________________________________________________________________________
    activation_83 (Activation)      (None, 8, 8, 384)    0           batch_normalization_83[0][0]
    __________________________________________________________________________________________________
    batch_normalization_84 (BatchNo (None, 8, 8, 192)    576         conv2d_84[0][0]
    __________________________________________________________________________________________________
    activation_76 (Activation)      (None, 8, 8, 320)    0           batch_normalization_76[0][0]
    __________________________________________________________________________________________________
    mixed9_0 (Concatenate)          (None, 8, 8, 768)    0           activation_78[0][0]
                                                                     activation_79[0][0]
    __________________________________________________________________________________________________
    concatenate (Concatenate)       (None, 8, 8, 768)    0           activation_82[0][0]
                                                                     activation_83[0][0]
    __________________________________________________________________________________________________
    activation_84 (Activation)      (None, 8, 8, 192)    0           batch_normalization_84[0][0]
    __________________________________________________________________________________________________
    mixed9 (Concatenate)            (None, 8, 8, 2048)   0           activation_76[0][0]
                                                                     mixed9_0[0][0]
                                                                     concatenate[0][0]
                                                                     activation_84[0][0]
    __________________________________________________________________________________________________
    conv2d_89 (Conv2D)              (None, 8, 8, 448)    917504      mixed9[0][0]
    __________________________________________________________________________________________________
    batch_normalization_89 (BatchNo (None, 8, 8, 448)    1344        conv2d_89[0][0]
    __________________________________________________________________________________________________
    activation_89 (Activation)      (None, 8, 8, 448)    0           batch_normalization_89[0][0]
    __________________________________________________________________________________________________
    conv2d_86 (Conv2D)              (None, 8, 8, 384)    786432      mixed9[0][0]
    __________________________________________________________________________________________________
    conv2d_90 (Conv2D)              (None, 8, 8, 384)    1548288     activation_89[0][0]
    __________________________________________________________________________________________________
    batch_normalization_86 (BatchNo (None, 8, 8, 384)    1152        conv2d_86[0][0]
    __________________________________________________________________________________________________
    batch_normalization_90 (BatchNo (None, 8, 8, 384)    1152        conv2d_90[0][0]
    __________________________________________________________________________________________________
    activation_86 (Activation)      (None, 8, 8, 384)    0           batch_normalization_86[0][0]
    __________________________________________________________________________________________________
    activation_90 (Activation)      (None, 8, 8, 384)    0           batch_normalization_90[0][0]
    __________________________________________________________________________________________________
    conv2d_87 (Conv2D)              (None, 8, 8, 384)    442368      activation_86[0][0]
    __________________________________________________________________________________________________
    conv2d_88 (Conv2D)              (None, 8, 8, 384)    442368      activation_86[0][0]
    __________________________________________________________________________________________________
    conv2d_91 (Conv2D)              (None, 8, 8, 384)    442368      activation_90[0][0]
    __________________________________________________________________________________________________
    conv2d_92 (Conv2D)              (None, 8, 8, 384)    442368      activation_90[0][0]
    __________________________________________________________________________________________________
    average_pooling2d_8 (AveragePoo (None, 8, 8, 2048)   0           mixed9[0][0]
    __________________________________________________________________________________________________
    conv2d_85 (Conv2D)              (None, 8, 8, 320)    655360      mixed9[0][0]
    __________________________________________________________________________________________________
    batch_normalization_87 (BatchNo (None, 8, 8, 384)    1152        conv2d_87[0][0]
    __________________________________________________________________________________________________
    batch_normalization_88 (BatchNo (None, 8, 8, 384)    1152        conv2d_88[0][0]
    __________________________________________________________________________________________________
    batch_normalization_91 (BatchNo (None, 8, 8, 384)    1152        conv2d_91[0][0]
    __________________________________________________________________________________________________
    batch_normalization_92 (BatchNo (None, 8, 8, 384)    1152        conv2d_92[0][0]
    __________________________________________________________________________________________________
    conv2d_93 (Conv2D)              (None, 8, 8, 192)    393216      average_pooling2d_8[0][0]
    __________________________________________________________________________________________________
    batch_normalization_85 (BatchNo (None, 8, 8, 320)    960         conv2d_85[0][0]
    __________________________________________________________________________________________________
    activation_87 (Activation)      (None, 8, 8, 384)    0           batch_normalization_87[0][0]
    __________________________________________________________________________________________________
    activation_88 (Activation)      (None, 8, 8, 384)    0           batch_normalization_88[0][0]
    __________________________________________________________________________________________________
    activation_91 (Activation)      (None, 8, 8, 384)    0           batch_normalization_91[0][0]
    __________________________________________________________________________________________________
    activation_92 (Activation)      (None, 8, 8, 384)    0           batch_normalization_92[0][0]
    __________________________________________________________________________________________________
    batch_normalization_93 (BatchNo (None, 8, 8, 192)    576         conv2d_93[0][0]
    __________________________________________________________________________________________________
    activation_85 (Activation)      (None, 8, 8, 320)    0           batch_normalization_85[0][0]
    __________________________________________________________________________________________________
    mixed9_1 (Concatenate)          (None, 8, 8, 768)    0           activation_87[0][0]
                                                                     activation_88[0][0]
    __________________________________________________________________________________________________
    concatenate_1 (Concatenate)     (None, 8, 8, 768)    0           activation_91[0][0]
                                                                     activation_92[0][0]
    __________________________________________________________________________________________________
    activation_93 (Activation)      (None, 8, 8, 192)    0           batch_normalization_93[0][0]
    __________________________________________________________________________________________________
    mixed10 (Concatenate)           (None, 8, 8, 2048)   0           activation_85[0][0]
                                                                     mixed9_1[0][0]
                                                                     concatenate_1[0][0]
                                                                     activation_93[0][0]
    __________________________________________________________________________________________________
    avg_pool (GlobalAveragePooling2 (None, 2048)         0           mixed10[0][0]
    __________________________________________________________________________________________________
    predictions (Dense)             (None, 1000)         2049000     avg_pool[0][0]
    ==================================================================================================
    Total params: 23,851,784
    Trainable params: 23,817,352
    Non-trainable params: 34,432
    __________________________________________________________________________________________________

We need to find a way to make the weigths of `inception_model` constant, instead of `tf.Variable`, otherwise, we cannot train for an adversarial attack.

```python
def non_dunder(obj, strict=False):
    if strict:
        prefix = "_"
    else:
        prefix = "__"
    return [s for s in dir(obj) if not s.startswith(prefix)]
```

```python
non_dunder(inception_model, True)
```

    ['activity_regularizer',
     'add_loss',
     'add_metric',
     'add_update',
     'add_variable',
     'add_weight',
     'apply',
     'build',
     'built',
     'call',
     'compile',
     'compiled_loss',
     'compiled_metrics',
     'compute_dtype',
     'compute_mask',
     'compute_output_shape',
     'compute_output_signature',
     'count_params',
     'distribute_strategy',
     'dtype',
     'dtype_policy',
     'dynamic',
     'evaluate',
     'evaluate_generator',
     'fit',
     'fit_generator',
     'from_config',
     'get_config',
     'get_input_at',
     'get_input_mask_at',
     'get_input_shape_at',
     'get_layer',
     'get_losses_for',
     'get_output_at',
     'get_output_mask_at',
     'get_output_shape_at',
     'get_updates_for',
     'get_weights',
     'history',
     'inbound_nodes',
     'input',
     'input_mask',
     'input_names',
     'input_shape',
     'input_spec',
     'inputs',
     'layers',
     'load_weights',
     'losses',
     'make_predict_function',
     'make_test_function',
     'make_train_function',
     'metrics',
     'metrics_names',
     'name',
     'name_scope',
     'non_trainable_variables',
     'non_trainable_weights',
     'optimizer',
     'outbound_nodes',
     'output',
     'output_mask',
     'output_names',
     'output_shape',
     'outputs',
     'predict',
     'predict_function',
     'predict_generator',
     'predict_on_batch',
     'predict_step',
     'reset_metrics',
     'reset_states',
     'run_eagerly',
     'save',
     'save_weights',
     'set_weights',
     'state_updates',
     'stateful',
     'stop_training',
     'submodules',
     'summary',
     'supports_masking',
     'test_function',
     'test_on_batch',
     'test_step',
     'to_json',
     'to_yaml',
     'train_function',
     'train_on_batch',
     'train_step',
     'trainable',
     'trainable_variables',
     'trainable_weights',
     'updates',
     'variable_dtype',
     'variables',
     'weights',
     'with_name_scope']

help(inception_model.stop_training)

```python
inception_model.trainable
```

    True

```python
inception_model.trainable = False
inception_model.trainable
```

    False

```python
inception_model.trainable_weights, inception_model.trainable_variables
```

    ([], [])

```python
inception_model.layers
```

    [<tensorflow.python.keras.engine.input_layer.InputLayer at 0x7fa9e41030a0>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a0b25a60>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a0b25f70>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a02a2c70>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a02a2cd0>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a020d4c0>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a0216760>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a0216220>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a021cbe0>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a0216fa0>,
     <tensorflow.python.keras.layers.pooling.MaxPooling2D at 0x7fa9a0226d00>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a020d970>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a021cee0>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a0226d30>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a35addf0>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a022e280>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a0228790>,
     <tensorflow.python.keras.layers.pooling.MaxPooling2D at 0x7fa9a022b6d0>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a01dfa60>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a01d9fa0>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a01d46a0>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a0228040>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a01df970>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a01c7100>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a02163a0>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a01c7250>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a01e6f40>,
     <tensorflow.python.keras.layers.pooling.AveragePooling2D at 0x7fa9a01f1940>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a01b4280>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a01d48b0>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a01d98e0>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a01e64f0>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a01b43d0>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a01c3100>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a01f0af0>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a01e6be0>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a01c7ca0>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a01d9b50>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a01d94c0>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a018daf0>,
     <tensorflow.python.keras.layers.merge.Concatenate at 0x7fa9a32c3550>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a1123c10>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a248ee20>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a01c7f70>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a10a48b0>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a10e1df0>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a109a8e0>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a0188220>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a10db5b0>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a0228550>,
     <tensorflow.python.keras.layers.pooling.AveragePooling2D at 0x7fa9a01a27f0>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a018dc10>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a10db340>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a022b970>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a01c3340>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a0188610>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a24a2220>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a021c8e0>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a01a9a60>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a10a4d90>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a10b2d30>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a02a2310>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a01b19a0>,
     <tensorflow.python.keras.layers.merge.Concatenate at 0x7fa9a021c340>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a0159280>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a015e610>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a01638b0>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a013bd90>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a0163130>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a0146850>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a0162f40>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a014c790>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a015e220>,
     <tensorflow.python.keras.layers.pooling.AveragePooling2D at 0x7fa9a00f4550>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a01a2430>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a0146640>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a016fa90>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a00fd070>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a013b910>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a0152d00>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a00fb400>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a0105460>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a0142850>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a0159c70>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a016feb0>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a00f43d0>,
     <tensorflow.python.keras.layers.merge.Concatenate at 0x7fa9a0163820>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a025ad30>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a1123460>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a24a21c0>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a01838b0>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a010d700>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a010e640>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a014c430>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a010d5b0>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a01a98b0>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a010fbb0>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a015e850>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a0116190>,
     <tensorflow.python.keras.layers.pooling.MaxPooling2D at 0x7fa9a0113b20>,
     <tensorflow.python.keras.layers.merge.Concatenate at 0x7fa9a010f310>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a00c6190>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a00bbb20>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a00d17c0>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a00d10a0>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a00d5880>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a00bb940>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a0116bb0>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a00cdaf0>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a0124ca0>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a00e7310>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a012b7f0>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a00e7c40>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a01131c0>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a00e1790>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a00b4790>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a00ede80>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a00bb6d0>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a00f2e80>,
     <tensorflow.python.keras.layers.pooling.AveragePooling2D at 0x7fa9a0082dc0>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a010db80>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a00b47f0>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a00ed4c0>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a0075100>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a0120880>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a00c0be0>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a0075ac0>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a00de640>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a0120d00>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a00c6b80>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a00820d0>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a012bf70>,
     <tensorflow.python.keras.layers.merge.Concatenate at 0x7fa9a0124640>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a0090e80>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a0097df0>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a0090bb0>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a009a1f0>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a00a4910>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a00ed280>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a0116e80>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a009aeb0>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a013edc0>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a00acf10>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a00893a0>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a0037310>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a0089dc0>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a0037a30>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a013ed00>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a003c9d0>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a008ac10>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a00acd30>,
     <tensorflow.python.keras.layers.pooling.AveragePooling2D at 0x7fa9a004e3a0>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a00b4040>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a0113a30>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a0042b50>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a003c880>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a0113790>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a0089bb0>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a0048e50>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a0053e50>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a020d670>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a0090d90>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a004ed90>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a00597f0>,
     <tensorflow.python.keras.layers.merge.Concatenate at 0x7fa9a005edf0>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a005e0d0>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a00e71c0>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a00de6a0>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a006db80>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9983caa00>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9983cb7c0>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a006dee0>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9983c5310>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a00654f0>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9983cce50>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a00725e0>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9983d1430>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9983bf100>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9983d1d30>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a0072040>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9983c5f10>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a005e730>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9983d3490>,
     <tensorflow.python.keras.layers.pooling.AveragePooling2D at 0x7fa9983e37f0>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a0059340>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a003cf70>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9983d7bb0>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9983e3f70>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a0065430>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a00b2a60>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9983d3e20>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9983cf940>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a006d220>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a004e940>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9983dfe20>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9983e83a0>,
     <tensorflow.python.keras.layers.merge.Concatenate at 0x7fa9983e8730>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa998392a30>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa99839d8b0>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9983a77f0>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa99839d820>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9983add60>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa99833b340>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9983f29a0>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa99833bd60>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9983f2100>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9983adb50>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9983e7eb0>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa99839b7c0>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa99837b550>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9983e3a00>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa99838aac0>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa99839d190>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa998388ca0>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9a006dd90>,
     <tensorflow.python.keras.layers.pooling.AveragePooling2D at 0x7fa998340c10>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9983f0d00>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa998388c40>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9a0048cd0>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa998344ee0>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9983df9a0>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa998395c70>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9a005e5b0>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9983a7850>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa998379a90>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9983952b0>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9983d3fa0>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9983d13d0>,
     <tensorflow.python.keras.layers.merge.Concatenate at 0x7fa998345d30>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa99834e0a0>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa99835adc0>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa998360eb0>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa99835a2e0>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa99835ac10>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa998347f40>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9983477c0>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa998355fd0>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa998348b20>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa99835a820>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa998345220>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa99835a4f0>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa99834bf70>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa998378df0>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa998355280>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa998370f10>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa998345640>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa99836af40>,
     <tensorflow.python.keras.layers.pooling.MaxPooling2D at 0x7fa998378d00>,
     <tensorflow.python.keras.layers.merge.Concatenate at 0x7fa9a01b4f10>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9983313d0>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa99831d760>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa998331520>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa998364f70>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa99835ad60>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9983704f0>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa998322c10>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa998315a30>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9983cae80>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa998312d90>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa998322f10>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa998379130>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa99830ad60>,
     <tensorflow.python.keras.layers.pooling.AveragePooling2D at 0x7fa9982c6af0>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9983480d0>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa998370760>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa99831dee0>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9983d1f10>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa998345f40>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9982b9d90>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9983783a0>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa998322e80>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa998331f40>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa998336d90>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9982bcac0>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9982b9d60>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa99830a070>,
     <tensorflow.python.keras.layers.merge.Concatenate at 0x7fa998331df0>,
     <tensorflow.python.keras.layers.merge.Concatenate at 0x7fa9982b9eb0>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9982c2e80>,
     <tensorflow.python.keras.layers.merge.Concatenate at 0x7fa9982c2550>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9982ec700>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9982e3dc0>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa998287670>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9982cddc0>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9982ebd60>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9982cda60>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa99828c580>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9982dd7f0>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa998287850>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9982c2fd0>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9982bce80>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa998287790>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa99827fd00>,
     <tensorflow.python.keras.layers.pooling.AveragePooling2D at 0x7fa9982adbb0>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9982d1b80>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9982dd700>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9982e3d60>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9982f2eb0>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa998293ca0>,
     <tensorflow.python.keras.layers.convolutional.Conv2D at 0x7fa9982ad190>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9982bcdc0>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9982ebca0>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9982ebdc0>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa998293df0>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9982a4af0>,
     <tensorflow.python.keras.layers.normalization_v2.BatchNormalization at 0x7fa9982a4250>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9982d1b20>,
     <tensorflow.python.keras.layers.merge.Concatenate at 0x7fa9982cdeb0>,
     <tensorflow.python.keras.layers.merge.Concatenate at 0x7fa9982a0ee0>,
     <tensorflow.python.keras.layers.core.Activation at 0x7fa9982af460>,
     <tensorflow.python.keras.layers.merge.Concatenate at 0x7fa9982f21c0>,
     <tensorflow.python.keras.layers.pooling.GlobalAveragePooling2D at 0x7fa99827f850>,
     <tensorflow.python.keras.layers.core.Dense at 0x7fa9a35b6880>]

```python
inception_model.layers[0].input.shape
```

    TensorShape([None, 299, 299, 3])

```python
image = tf.Variable(tf.zeros((1, 299, 299, 3)))
```
adversarial_model = keras.Model(
    inputs=image,
    outputs=inception_model(image),
)ValueError: Input tensors to a Functional must come from `tf.keras.Input`. Received: <tf.Variable 'Variable:0'>
How should we solve this question?

Note that although we cannot make a model using `tf.Variable` as input,
we can make `image` input of `inception_model`.

```python
inception_model(image)
```

    <tf.Tensor: shape=(1, 1000), dtype=float32, numpy=
    array([[4.31017659e-04, 3.32327909e-04, 2.53500999e-04, 2.83194327e-04,
            5.22126618e-04, 5.37490763e-04, 1.18336444e-04, 4.60172945e-04,
            3.42794083e-04, 4.87075537e-04, 3.46313929e-04, 1.81991563e-04,
            1.77539114e-04, 1.48301086e-04, 1.54501220e-04, 2.95949198e-04,
            5.15563646e-04, 2.00293653e-04, 3.23193759e-04, 1.81776733e-04,
            3.00646410e-04, 2.68637203e-03, 1.27837004e-03, 4.35263617e-04,
            3.66052263e-04, 2.31926053e-04, 3.03516310e-04, 2.33348750e-04,
            3.61928920e-04, 2.23213909e-04, 1.03388913e-04, 4.41607845e-04,
            1.57879767e-04, 3.36226367e-04, 8.01972812e-04, 1.39403695e-04,
            2.14718399e-04, 1.34171234e-04, 1.01800147e-03, 2.11177612e-04,
            2.42629365e-04, 2.92203942e-04, 4.07369691e-04, 3.71638598e-04,
            2.47096963e-04, 3.51564842e-04, 4.14005481e-04, 3.85800435e-04,
            2.10099504e-04, 1.34753223e-04, 1.68580053e-04, 4.41498152e-04,
            8.07606906e-04, 5.78033796e-04, 2.17680179e-04, 2.92287266e-04,
            3.09867959e-04, 1.33472189e-04, 1.93140062e-04, 1.05897302e-03,
            6.63121697e-04, 2.99376203e-04, 2.39970454e-04, 1.38128956e-03,
            5.77031111e-04, 3.92016082e-04, 6.21223706e-04, 2.25631098e-04,
            4.54294612e-04, 2.33854327e-04, 1.86976089e-04, 1.48820551e-03,
            1.73854249e-04, 1.96889136e-03, 1.21429788e-04, 3.05241148e-04,
            2.34179039e-04, 3.58676160e-04, 1.69498625e-03, 1.12126779e-03,
            9.37525008e-04, 4.19565127e-04, 2.57610111e-04, 2.46157782e-04,
            2.17347246e-04, 2.56272207e-04, 5.61003806e-04, 4.76953544e-04,
            3.39559425e-04, 2.92111421e-04, 2.98810453e-04, 4.75636189e-04,
            1.08991843e-03, 2.71222350e-04, 7.94989464e-04, 2.21299386e-04,
            6.32052135e-04, 1.30110027e-04, 4.83009906e-04, 2.14947140e-04,
            1.39067415e-04, 2.05406832e-04, 1.81641211e-04, 5.79028740e-04,
            1.74732049e-04, 1.05572755e-04, 2.47199961e-04, 9.64014442e-04,
            1.85149955e-04, 1.71288222e-04, 4.23854304e-04, 2.36184858e-02,
            1.05460105e-03, 4.42122895e-04, 3.17422207e-04, 2.33531071e-04,
            2.04499986e-04, 1.04962836e-03, 8.49505959e-05, 1.67210892e-04,
            1.96968103e-04, 2.08005673e-04, 2.79575266e-04, 1.05112078e-04,
            2.27719080e-04, 1.86842924e-04, 1.70262263e-03, 7.60937575e-04,
            2.26440537e-03, 4.84879303e-04, 2.08368889e-04, 2.28228499e-04,
            2.68597330e-04, 2.41861562e-04, 1.71436841e-04, 1.88584861e-04,
            1.66989790e-04, 1.66823535e-04, 2.99431878e-04, 1.74959903e-04,
            1.91861967e-04, 6.54649513e-04, 2.78294290e-04, 4.58211929e-04,
            2.07621881e-04, 2.54930434e-04, 5.94788755e-04, 5.52624930e-04,
            3.23771092e-04, 8.70805001e-04, 9.73949427e-05, 2.78880645e-04,
            5.93514182e-04, 4.13187838e-04, 1.41126322e-04, 2.04751734e-04,
            2.15093969e-04, 2.13827661e-04, 2.57866108e-04, 1.24639482e-04,
            2.41888658e-04, 4.30268759e-04, 4.09375818e-04, 9.18734237e-04,
            4.11938207e-04, 3.79382167e-04, 4.02062171e-04, 3.17296595e-04,
            3.06517817e-04, 1.89828716e-04, 2.23258830e-04, 2.34153835e-04,
            1.98402020e-04, 2.44797644e-04, 1.66573780e-04, 4.62542055e-04,
            1.73092325e-04, 1.68730126e-04, 4.47060709e-04, 9.94441725e-05,
            1.43269746e-04, 5.23785944e-04, 1.60125463e-04, 1.88798629e-04,
            2.21058173e-04, 2.20526606e-04, 1.87882877e-04, 2.94994214e-04,
            3.80064448e-04, 2.99502717e-04, 6.87855470e-04, 2.36882450e-04,
            8.73345780e-05, 3.14394740e-04, 3.27155518e-04, 8.64682428e-04,
            2.65596376e-04, 2.25751835e-04, 2.95117614e-04, 3.01817054e-04,
            3.41674604e-04, 1.15952804e-04, 2.89845106e-04, 2.90510245e-04,
            2.70255550e-04, 1.62625278e-04, 3.42981773e-04, 2.32292194e-04,
            1.54052468e-04, 2.61054229e-04, 3.04624176e-04, 1.78284390e-04,
            1.03559476e-04, 1.19037526e-04, 1.83347322e-04, 1.85074648e-04,
            5.06278477e-04, 2.55744468e-04, 1.82173622e-04, 1.20334742e-04,
            7.12111709e-04, 3.69854301e-04, 2.60072557e-04, 6.07538095e-04,
            2.51110614e-04, 1.15692790e-04, 1.44718637e-04, 2.35954416e-04,
            2.93805904e-04, 3.82566155e-04, 9.21472893e-05, 1.14840586e-04,
            1.34359405e-04, 2.75242695e-04, 3.00140062e-04, 2.71424709e-04,
            2.30947640e-04, 2.30791091e-04, 2.74164253e-04, 3.10060859e-04,
            1.29079519e-04, 2.29139900e-04, 1.34136950e-04, 2.27497920e-04,
            1.95328248e-04, 2.30148973e-04, 2.68373435e-04, 3.17951024e-04,
            1.87683545e-04, 2.95876525e-04, 2.84669659e-04, 3.94420960e-04,
            4.09921748e-04, 1.00913654e-04, 2.13742431e-04, 9.46031359e-05,
            2.68370379e-04, 2.27634315e-04, 3.16442311e-04, 2.73989688e-04,
            2.68192816e-04, 3.43298743e-04, 1.56463226e-04, 2.00522321e-04,
            1.18972108e-04, 2.43496906e-04, 6.50043774e-04, 2.24764939e-04,
            1.37867188e-04, 1.68263956e-04, 3.25672998e-04, 1.64144716e-04,
            1.13209309e-04, 1.75845722e-04, 2.81687797e-04, 2.09266043e-04,
            2.42034381e-04, 2.48531374e-04, 1.59713614e-04, 4.40178672e-04,
            2.15198306e-04, 2.09840582e-04, 2.07322810e-04, 6.14351535e-04,
            3.79779463e-04, 5.26642194e-04, 1.06596388e-04, 1.17388452e-04,
            2.73519749e-04, 2.74945865e-04, 1.17372947e-04, 2.12115905e-04,
            1.24904836e-04, 3.23327229e-04, 1.60611584e-04, 1.72497515e-04,
            2.34043197e-04, 9.81419347e-04, 1.73290289e-04, 2.63302150e-04,
            3.77508346e-04, 2.61711451e-04, 7.55109417e-04, 5.16184024e-04,
            3.55890865e-04, 3.02752102e-04, 1.16276124e-03, 4.34165646e-04,
            5.70104748e-04, 1.08946791e-04, 8.50972836e-04, 3.28036404e-04,
            6.29933609e-04, 4.09383589e-04, 1.32836786e-03, 5.55905746e-04,
            3.22396896e-04, 3.27749469e-04, 2.09232699e-03, 5.10437356e-04,
            3.79433768e-04, 2.18492161e-04, 1.66520738e-04, 1.71922875e-04,
            1.91633488e-04, 1.64118959e-04, 6.43216597e-04, 1.75045017e-04,
            1.66457467e-04, 2.84778391e-04, 2.98900355e-04, 2.41021829e-04,
            5.05230273e-04, 1.35703929e-04, 2.43241127e-04, 1.18125419e-04,
            1.53266577e-04, 1.77115828e-04, 2.04386219e-04, 1.78191156e-04,
            1.38138450e-04, 1.54491208e-04, 1.99216462e-04, 1.55891292e-04,
            1.18483753e-04, 3.27447371e-04, 1.16895448e-04, 2.64636823e-04,
            1.63949764e-04, 2.58355227e-04, 4.17695701e-04, 4.68137296e-04,
            1.23320744e-04, 2.94071651e-04, 7.01069424e-04, 1.86617573e-04,
            3.40105355e-04, 2.53640814e-04, 4.18193551e-04, 8.69446609e-04,
            8.75655896e-05, 5.48892887e-04, 2.54289160e-04, 1.94400825e-04,
            3.19751358e-04, 1.72161264e-04, 1.65672405e-04, 1.73440654e-04,
            1.63041055e-04, 2.98198953e-04, 1.46537117e-04, 1.96465422e-04,
            1.00543293e-04, 1.02311351e-04, 1.12981303e-04, 2.24402436e-04,
            3.68654000e-04, 1.70339481e-04, 2.57129170e-04, 1.95769186e-04,
            2.14790183e-04, 1.78730159e-04, 1.04971630e-04, 9.87669773e-05,
            3.46515473e-04, 1.57799746e-04, 1.33955997e-04, 2.42021008e-04,
            2.40706795e-04, 3.89044406e-04, 1.64616809e-04, 1.11771842e-04,
            3.89627705e-04, 1.60345124e-04, 2.19717549e-04, 4.93793574e-04,
            1.07018081e-04, 2.05279910e-04, 5.17394859e-04, 2.65106955e-03,
            8.08921934e-04, 5.36964973e-04, 2.24157912e-03, 5.48603013e-04,
            1.06986368e-03, 2.54735467e-03, 4.57065507e-05, 1.18414224e-04,
            2.96746322e-04, 3.75186373e-03, 1.30606917e-04, 3.94626579e-04,
            3.63035128e-04, 5.33189392e-03, 3.95004230e-04, 6.65952321e-05,
            2.35600281e-03, 1.00369367e-03, 8.07490107e-03, 2.32929410e-03,
            1.33267383e-03, 4.24810918e-04, 1.45477382e-03, 6.07752067e-04,
            1.85557918e-04, 2.38253589e-04, 9.96938907e-04, 6.49390393e-04,
            2.67331983e-04, 1.82149257e-03, 3.14323232e-04, 6.49094756e-04,
            5.21200895e-03, 3.58371006e-04, 3.25357745e-04, 6.26045396e-04,
            2.69786629e-04, 5.88408264e-04, 8.42765265e-04, 5.47021162e-04,
            5.00769762e-04, 6.54203293e-04, 1.11391896e-03, 7.61769654e-04,
            2.27099488e-04, 8.18898552e-04, 8.94559827e-03, 1.57790235e-03,
            2.73633748e-04, 2.36899257e-04, 2.92421086e-04, 5.01101976e-03,
            2.64426460e-04, 1.25255421e-04, 1.29494045e-04, 9.53262032e-04,
            2.97414744e-03, 8.78280378e-04, 1.15708732e-04, 1.73389190e-03,
            2.56283354e-04, 4.03606944e-04, 3.39863473e-03, 4.52094362e-04,
            2.86964327e-03, 2.35359650e-03, 1.78925678e-04, 8.11243808e-05,
            2.24615695e-04, 7.99397647e-04, 2.28532730e-03, 1.86813806e-04,
            1.72678730e-04, 1.44965490e-02, 1.99825154e-04, 5.19107911e-04,
            7.37041191e-05, 7.01951387e-04, 8.08525714e-04, 4.14509210e-04,
            4.21113684e-04, 2.15298473e-03, 8.47216579e-04, 2.16632892e-04,
            3.22489475e-04, 9.33125732e-04, 1.06022193e-03, 2.58509512e-03,
            3.03151412e-03, 1.87200101e-04, 5.93128963e-04, 1.67209620e-03,
            6.62064122e-04, 3.01788445e-04, 1.49866333e-03, 2.13367690e-04,
            3.23776039e-04, 2.72237550e-04, 3.92542075e-04, 9.85758845e-03,
            7.40982359e-04, 5.74527774e-04, 7.73853273e-04, 1.47410284e-03,
            1.49981328e-03, 1.03790942e-03, 4.86196746e-04, 3.90688237e-03,
            5.80731023e-04, 1.23153281e-04, 3.99681361e-04, 2.57574487e-04,
            1.16338497e-02, 3.25201266e-03, 1.28291058e-03, 6.16475882e-04,
            4.83501877e-04, 9.00970830e-04, 3.51564348e-04, 7.08194624e-04,
            2.77735904e-04, 3.56427685e-04, 5.65448194e-04, 8.84272798e-04,
            3.06223723e-04, 2.49172153e-04, 4.82564530e-04, 1.27625291e-03,
            8.59298569e-04, 5.95574325e-04, 8.39067250e-03, 8.87191622e-04,
            2.25346594e-04, 2.45771196e-04, 6.97862590e-03, 2.62489804e-04,
            1.04487030e-04, 2.82361812e-04, 5.93842240e-04, 1.17975334e-03,
            1.05527206e-03, 9.42039420e-04, 5.76536590e-03, 2.90641328e-03,
            3.40179802e-04, 1.09828217e-03, 2.58015376e-03, 2.25467404e-04,
            1.66573300e-04, 2.03613974e-02, 9.29033442e-04, 3.07947793e-03,
            4.33473993e-04, 1.09477725e-03, 3.17225349e-04, 1.82619362e-04,
            1.42836734e-03, 5.97553386e-04, 2.89450795e-03, 1.82199944e-03,
            3.82221740e-04, 2.13528925e-04, 2.18884350e-04, 3.52357840e-03,
            1.30867134e-04, 3.65642132e-04, 9.39228223e-04, 3.03392834e-03,
            2.05056393e-04, 1.82752992e-04, 6.39256032e-04, 1.81708514e-04,
            1.15869287e-03, 1.93608124e-04, 1.92845135e-03, 1.38337578e-04,
            2.64814822e-04, 1.26312056e-03, 6.27006229e-04, 3.11307813e-04,
            1.09390785e-04, 8.87452261e-05, 7.98691472e-05, 2.42582755e-03,
            7.13303592e-03, 1.37009134e-03, 2.93682213e-04, 6.58102939e-03,
            1.44671160e-03, 4.61196853e-03, 1.13449083e-03, 7.56042718e-04,
            1.94935815e-03, 4.52752411e-03, 6.84334314e-04, 2.62726215e-04,
            1.30079323e-02, 1.25415681e-03, 2.42376715e-04, 5.98623825e-04,
            9.82295536e-03, 9.07995156e-04, 1.60420698e-03, 1.59842515e-04,
            4.10768809e-03, 1.18418271e-03, 2.45229644e-03, 1.50090922e-03,
            4.51364089e-04, 1.38494535e-04, 3.95357003e-03, 4.14689886e-04,
            1.31356777e-04, 3.44144413e-03, 2.55281630e-04, 1.40664633e-03,
            2.69397488e-03, 3.30543146e-04, 3.50492052e-03, 6.24120235e-04,
            9.04167246e-04, 2.70553399e-04, 1.34927023e-03, 1.51513303e-02,
            3.89233282e-05, 3.12657561e-04, 6.77008834e-03, 3.77814140e-04,
            3.93154623e-04, 5.47926174e-03, 7.20481621e-04, 2.02784431e-03,
            3.95234767e-03, 4.85303160e-03, 2.22530041e-04, 4.00264421e-03,
            1.23228587e-03, 1.47698898e-04, 5.25866169e-04, 5.85559465e-04,
            1.84543358e-04, 1.11156153e-02, 6.57973345e-04, 7.15211616e-04,
            6.78176247e-03, 2.97191960e-04, 1.88440856e-04, 1.22486253e-03,
            3.40964034e-04, 2.82469002e-04, 9.05810110e-03, 8.96631042e-04,
            2.75160681e-04, 4.40291158e-04, 2.30068967e-04, 4.18182550e-04,
            1.52740409e-04, 1.10090442e-03, 4.00019635e-04, 5.65125141e-04,
            2.17709880e-04, 1.35380847e-04, 5.53996209e-03, 1.59425530e-04,
            1.61592790e-03, 2.05656339e-04, 1.91578676e-03, 1.33046450e-03,
            6.94764836e-04, 1.81871845e-04, 1.53529472e-04, 9.08947768e-05,
            5.67504729e-04, 2.40932894e-03, 6.32830011e-03, 2.18763191e-04,
            1.38127711e-03, 5.52792801e-03, 1.21923466e-03, 2.43208790e-03,
            4.08641482e-03, 3.67284007e-03, 4.51402040e-04, 5.56178298e-03,
            4.45538899e-03, 3.47183959e-04, 3.97576066e-03, 1.09298802e-04,
            3.94371105e-04, 3.69205518e-04, 1.19593838e-04, 1.08329928e-03,
            8.09790276e-04, 5.78269653e-04, 1.60634940e-04, 6.28648268e-04,
            3.17114079e-03, 2.86961586e-04, 3.03517474e-04, 9.06390138e-03,
            2.08563427e-03, 1.71087205e-03, 9.75787989e-04, 1.26213432e-04,
            2.15223554e-04, 1.61504897e-04, 1.70251791e-04, 2.62864196e-04,
            1.09848566e-03, 4.80393704e-04, 2.40925886e-03, 1.86333840e-03,
            6.23044907e-04, 5.18005982e-04, 7.00132037e-03, 1.32973760e-03,
            1.48919717e-04, 1.82065152e-04, 5.23712719e-04, 2.37063458e-03,
            2.46436032e-03, 1.58215204e-04, 1.40726287e-03, 6.73403498e-04,
            3.12212069e-04, 4.80794959e-04, 2.25748401e-03, 2.76565406e-04,
            3.18697101e-04, 8.67756316e-04, 4.70146711e-04, 1.12572117e-02,
            1.56847108e-03, 6.49675902e-04, 1.34192931e-04, 2.96985847e-04,
            1.15577981e-03, 3.81888531e-04, 5.04172815e-04, 5.09698351e-04,
            4.62367525e-03, 1.04509360e-04, 8.92789220e-04, 3.04489717e-04,
            2.71511567e-03, 1.69752201e-03, 1.29530916e-03, 2.08561099e-03,
            5.29477024e-04, 7.91654177e-03, 3.03580164e-04, 1.68663842e-04,
            8.76768783e-04, 7.58939015e-04, 4.80433553e-03, 4.09703469e-04,
            2.68897216e-04, 8.53438178e-05, 1.61902758e-03, 1.09014381e-03,
            1.00139214e-03, 4.81274491e-03, 9.35530115e-05, 1.19497906e-02,
            1.88810751e-03, 6.64997555e-04, 4.93518310e-04, 1.79226010e-03,
            3.96590331e-04, 6.06207084e-03, 5.86070644e-04, 1.83126610e-03,
            4.78950795e-03, 4.89645929e-04, 1.22431153e-03, 2.58975866e-04,
            3.31775309e-03, 1.90833316e-03, 1.65264262e-03, 2.80162465e-04,
            6.28052454e-04, 4.02738340e-04, 1.19492773e-03, 6.30794652e-03,
            5.08740824e-03, 4.33828100e-04, 3.83373175e-04, 3.69200250e-04,
            7.59296017e-05, 4.25498787e-04, 4.95904824e-04, 2.19123802e-04,
            3.17009725e-03, 5.00731519e-04, 2.91224394e-04, 8.26855714e-04,
            1.31580967e-03, 7.54667388e-04, 9.31899995e-04, 2.14088432e-04,
            1.80645482e-04, 6.10732706e-04, 2.53553968e-04, 2.68190895e-04,
            2.71406025e-03, 6.60185702e-04, 3.40428582e-04, 2.44963332e-04,
            6.80986210e-04, 2.59857363e-04, 6.40409417e-04, 1.40203722e-03,
            1.87738996e-03, 6.29420159e-03, 3.53865646e-04, 1.67972394e-04,
            4.75145120e-04, 5.02187351e-04, 3.80670442e-03, 3.41019622e-04,
            1.84361459e-04, 6.31931587e-04, 5.04152966e-04, 2.33482523e-03,
            2.95605481e-04, 2.20141970e-04, 3.00868344e-03, 5.77666913e-04,
            3.23020550e-03, 1.05666069e-04, 6.79129211e-04, 8.26597738e-04,
            3.69953108e-04, 9.59029538e-04, 1.00499345e-03, 3.48639383e-04,
            2.13893643e-03, 1.43731013e-03, 1.72336702e-03, 6.54498406e-04,
            2.12765741e-03, 1.03076093e-03, 6.30141352e-04, 3.95241659e-04,
            5.53232664e-03, 6.30976819e-03, 4.04596794e-03, 3.88082262e-04,
            9.87098902e-04, 4.32199595e-04, 2.65133247e-04, 1.00008340e-03,
            3.05240718e-03, 3.07267619e-04, 3.70005309e-03, 1.93173788e-03,
            4.54633206e-04, 1.46008562e-04, 3.96106509e-04, 7.80071656e-04,
            2.46609387e-04, 2.46913102e-03, 2.04083091e-03, 3.31882591e-04,
            1.95188477e-04, 4.80476265e-05, 3.02570406e-04, 2.04313925e-04,
            7.17516057e-04, 2.40369569e-04, 4.52732609e-04, 6.06709684e-04,
            2.26780167e-03, 2.82891968e-04, 1.22921992e-04, 2.04822724e-03,
            5.82863053e-04, 4.16569295e-04, 3.87762237e-04, 5.64686197e-04,
            3.38086451e-04, 9.49157693e-04, 8.13786231e-04, 1.31063792e-03,
            1.09743596e-04, 2.75287335e-03, 2.02061623e-04, 8.07171091e-05,
            1.96939553e-04, 9.09353606e-04, 1.53033980e-04, 1.24149153e-03,
            3.10234493e-03, 2.61034607e-03, 3.09369556e-04, 8.52014695e-04,
            6.72589988e-04, 1.79396034e-03, 1.12065440e-03, 1.12451485e-03,
            5.06201701e-04, 1.33546290e-03, 1.23144360e-02, 7.06574880e-04,
            5.05107106e-04, 5.26652730e-04, 1.97947607e-03, 8.56725208e-04,
            5.31544385e-04, 5.11502265e-04, 7.62607495e-04, 4.27063322e-04,
            1.01769372e-04, 6.04480098e-04, 5.72585152e-04, 2.12122963e-04,
            8.34001508e-03, 4.31383669e-04, 6.83368125e-04, 5.07465331e-04,
            1.23964506e-03, 1.10130501e-03, 1.16553903e-03, 1.78703238e-04,
            2.12791609e-04, 2.43181988e-04, 2.50502722e-04, 3.92852176e-04,
            1.71522872e-04, 5.94265759e-04, 4.05053492e-04, 2.08003461e-04,
            2.06163866e-04, 3.04257643e-04, 3.42190295e-04, 1.87668964e-04,
            4.94735257e-04, 2.80525797e-04, 2.72983685e-04, 1.70266881e-04,
            7.30464701e-04, 1.80728704e-04, 2.43748407e-04, 4.06203908e-04,
            3.22917243e-04, 3.89484485e-04, 1.26809202e-04, 1.16987118e-04,
            1.32209691e-03, 1.26505992e-03, 3.35869845e-04, 5.99219988e-04,
            3.33936885e-04, 3.64890584e-04, 9.77205113e-04, 1.94607012e-04,
            4.46895196e-04, 6.07365335e-04, 2.96518032e-04, 2.04842159e-04,
            3.93499125e-04, 1.61896431e-04, 1.87652040e-04, 2.47599033e-04,
            2.56193394e-04, 3.18844541e-04, 4.18812549e-03, 7.49662053e-04,
            2.27773911e-03, 1.56674639e-03, 1.59595613e-04, 9.91765526e-04,
            3.81028338e-04, 1.28106840e-04, 6.00004219e-04, 2.34095540e-04,
            5.96470316e-04, 4.68617684e-04, 3.62708466e-04, 2.40147550e-04,
            6.19315892e-04, 3.15373094e-04, 2.69917597e-04, 2.39481102e-04,
            3.59471829e-04, 3.30602576e-04, 2.91448756e-04, 4.88097721e-04,
            3.70328315e-04, 1.75041103e-04, 5.84556430e-04, 1.19893659e-04,
            2.19421374e-04, 1.89885759e-04, 1.96750887e-04, 1.31323963e-04,
            1.52892113e-04, 1.27014413e-04, 2.32537670e-04, 8.25775322e-04]],
          dtype=float32)>

```python
import json
from pathlib import Path
from urllib.request import urlretrieve
```

```python
imagenet_json = Path("imagenet.json")
if not imagenet_json.exists():
    imagenet_json, _ = urlretrieve(
        'https://www.anishathalye.com/media/2017/07/25/imagenet.json'
    )

with open(imagenet_json) as f:
    imagenet_labels = json.load(f)
imagenet_labels
```

    ['tench, Tinca tinca',
     'goldfish, Carassius auratus',
     'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias',
     'tiger shark, Galeocerdo cuvieri',
     'hammerhead, hammerhead shark',
     'electric ray, crampfish, numbfish, torpedo',
     'stingray',
     'cock',
     'hen',
     'ostrich, Struthio camelus',
     'brambling, Fringilla montifringilla',
     'goldfinch, Carduelis carduelis',
     'house finch, linnet, Carpodacus mexicanus',
     'junco, snowbird',
     'indigo bunting, indigo finch, indigo bird, Passerina cyanea',
     'robin, American robin, Turdus migratorius',
     'bulbul',
     'jay',
     'magpie',
     'chickadee',
     'water ouzel, dipper',
     'kite',
     'bald eagle, American eagle, Haliaeetus leucocephalus',
     'vulture',
     'great grey owl, great gray owl, Strix nebulosa',
     'European fire salamander, Salamandra salamandra',
     'common newt, Triturus vulgaris',
     'eft',
     'spotted salamander, Ambystoma maculatum',
     'axolotl, mud puppy, Ambystoma mexicanum',
     'bullfrog, Rana catesbeiana',
     'tree frog, tree-frog',
     'tailed frog, bell toad, ribbed toad, tailed toad, Ascaphus trui',
     'loggerhead, loggerhead turtle, Caretta caretta',
     'leatherback turtle, leatherback, leathery turtle, Dermochelys coriacea',
     'mud turtle',
     'terrapin',
     'box turtle, box tortoise',
     'banded gecko',
     'common iguana, iguana, Iguana iguana',
     'American chameleon, anole, Anolis carolinensis',
     'whiptail, whiptail lizard',
     'agama',
     'frilled lizard, Chlamydosaurus kingi',
     'alligator lizard',
     'Gila monster, Heloderma suspectum',
     'green lizard, Lacerta viridis',
     'African chameleon, Chamaeleo chamaeleon',
     'Komodo dragon, Komodo lizard, dragon lizard, giant lizard, Varanus komodoensis',
     'African crocodile, Nile crocodile, Crocodylus niloticus',
     'American alligator, Alligator mississipiensis',
     'triceratops',
     'thunder snake, worm snake, Carphophis amoenus',
     'ringneck snake, ring-necked snake, ring snake',
     'hognose snake, puff adder, sand viper',
     'green snake, grass snake',
     'king snake, kingsnake',
     'garter snake, grass snake',
     'water snake',
     'vine snake',
     'night snake, Hypsiglena torquata',
     'boa constrictor, Constrictor constrictor',
     'rock python, rock snake, Python sebae',
     'Indian cobra, Naja naja',
     'green mamba',
     'sea snake',
     'horned viper, cerastes, sand viper, horned asp, Cerastes cornutus',
     'diamondback, diamondback rattlesnake, Crotalus adamanteus',
     'sidewinder, horned rattlesnake, Crotalus cerastes',
     'trilobite',
     'harvestman, daddy longlegs, Phalangium opilio',
     'scorpion',
     'black and gold garden spider, Argiope aurantia',
     'barn spider, Araneus cavaticus',
     'garden spider, Aranea diademata',
     'black widow, Latrodectus mactans',
     'tarantula',
     'wolf spider, hunting spider',
     'tick',
     'centipede',
     'black grouse',
     'ptarmigan',
     'ruffed grouse, partridge, Bonasa umbellus',
     'prairie chicken, prairie grouse, prairie fowl',
     'peacock',
     'quail',
     'partridge',
     'African grey, African gray, Psittacus erithacus',
     'macaw',
     'sulphur-crested cockatoo, Kakatoe galerita, Cacatua galerita',
     'lorikeet',
     'coucal',
     'bee eater',
     'hornbill',
     'hummingbird',
     'jacamar',
     'toucan',
     'drake',
     'red-breasted merganser, Mergus serrator',
     'goose',
     'black swan, Cygnus atratus',
     'tusker',
     'echidna, spiny anteater, anteater',
     'platypus, duckbill, duckbilled platypus, duck-billed platypus, Ornithorhynchus anatinus',
     'wallaby, brush kangaroo',
     'koala, koala bear, kangaroo bear, native bear, Phascolarctos cinereus',
     'wombat',
     'jellyfish',
     'sea anemone, anemone',
     'brain coral',
     'flatworm, platyhelminth',
     'nematode, nematode worm, roundworm',
     'conch',
     'snail',
     'slug',
     'sea slug, nudibranch',
     'chiton, coat-of-mail shell, sea cradle, polyplacophore',
     'chambered nautilus, pearly nautilus, nautilus',
     'Dungeness crab, Cancer magister',
     'rock crab, Cancer irroratus',
     'fiddler crab',
     'king crab, Alaska crab, Alaskan king crab, Alaska king crab, Paralithodes camtschatica',
     'American lobster, Northern lobster, Maine lobster, Homarus americanus',
     'spiny lobster, langouste, rock lobster, crawfish, crayfish, sea crawfish',
     'crayfish, crawfish, crawdad, crawdaddy',
     'hermit crab',
     'isopod',
     'white stork, Ciconia ciconia',
     'black stork, Ciconia nigra',
     'spoonbill',
     'flamingo',
     'little blue heron, Egretta caerulea',
     'American egret, great white heron, Egretta albus',
     'bittern',
     'crane',
     'limpkin, Aramus pictus',
     'European gallinule, Porphyrio porphyrio',
     'American coot, marsh hen, mud hen, water hen, Fulica americana',
     'bustard',
     'ruddy turnstone, Arenaria interpres',
     'red-backed sandpiper, dunlin, Erolia alpina',
     'redshank, Tringa totanus',
     'dowitcher',
     'oystercatcher, oyster catcher',
     'pelican',
     'king penguin, Aptenodytes patagonica',
     'albatross, mollymawk',
     'grey whale, gray whale, devilfish, Eschrichtius gibbosus, Eschrichtius robustus',
     'killer whale, killer, orca, grampus, sea wolf, Orcinus orca',
     'dugong, Dugong dugon',
     'sea lion',
     'Chihuahua',
     'Japanese spaniel',
     'Maltese dog, Maltese terrier, Maltese',
     'Pekinese, Pekingese, Peke',
     'Shih-Tzu',
     'Blenheim spaniel',
     'papillon',
     'toy terrier',
     'Rhodesian ridgeback',
     'Afghan hound, Afghan',
     'basset, basset hound',
     'beagle',
     'bloodhound, sleuthhound',
     'bluetick',
     'black-and-tan coonhound',
     'Walker hound, Walker foxhound',
     'English foxhound',
     'redbone',
     'borzoi, Russian wolfhound',
     'Irish wolfhound',
     'Italian greyhound',
     'whippet',
     'Ibizan hound, Ibizan Podenco',
     'Norwegian elkhound, elkhound',
     'otterhound, otter hound',
     'Saluki, gazelle hound',
     'Scottish deerhound, deerhound',
     'Weimaraner',
     'Staffordshire bullterrier, Staffordshire bull terrier',
     'American Staffordshire terrier, Staffordshire terrier, American pit bull terrier, pit bull terrier',
     'Bedlington terrier',
     'Border terrier',
     'Kerry blue terrier',
     'Irish terrier',
     'Norfolk terrier',
     'Norwich terrier',
     'Yorkshire terrier',
     'wire-haired fox terrier',
     'Lakeland terrier',
     'Sealyham terrier, Sealyham',
     'Airedale, Airedale terrier',
     'cairn, cairn terrier',
     'Australian terrier',
     'Dandie Dinmont, Dandie Dinmont terrier',
     'Boston bull, Boston terrier',
     'miniature schnauzer',
     'giant schnauzer',
     'standard schnauzer',
     'Scotch terrier, Scottish terrier, Scottie',
     'Tibetan terrier, chrysanthemum dog',
     'silky terrier, Sydney silky',
     'soft-coated wheaten terrier',
     'West Highland white terrier',
     'Lhasa, Lhasa apso',
     'flat-coated retriever',
     'curly-coated retriever',
     'golden retriever',
     'Labrador retriever',
     'Chesapeake Bay retriever',
     'German short-haired pointer',
     'vizsla, Hungarian pointer',
     'English setter',
     'Irish setter, red setter',
     'Gordon setter',
     'Brittany spaniel',
     'clumber, clumber spaniel',
     'English springer, English springer spaniel',
     'Welsh springer spaniel',
     'cocker spaniel, English cocker spaniel, cocker',
     'Sussex spaniel',
     'Irish water spaniel',
     'kuvasz',
     'schipperke',
     'groenendael',
     'malinois',
     'briard',
     'kelpie',
     'komondor',
     'Old English sheepdog, bobtail',
     'Shetland sheepdog, Shetland sheep dog, Shetland',
     'collie',
     'Border collie',
     'Bouvier des Flandres, Bouviers des Flandres',
     'Rottweiler',
     'German shepherd, German shepherd dog, German police dog, alsatian',
     'Doberman, Doberman pinscher',
     'miniature pinscher',
     'Greater Swiss Mountain dog',
     'Bernese mountain dog',
     'Appenzeller',
     'EntleBucher',
     'boxer',
     'bull mastiff',
     'Tibetan mastiff',
     'French bulldog',
     'Great Dane',
     'Saint Bernard, St Bernard',
     'Eskimo dog, husky',
     'malamute, malemute, Alaskan malamute',
     'Siberian husky',
     'dalmatian, coach dog, carriage dog',
     'affenpinscher, monkey pinscher, monkey dog',
     'basenji',
     'pug, pug-dog',
     'Leonberg',
     'Newfoundland, Newfoundland dog',
     'Great Pyrenees',
     'Samoyed, Samoyede',
     'Pomeranian',
     'chow, chow chow',
     'keeshond',
     'Brabancon griffon',
     'Pembroke, Pembroke Welsh corgi',
     'Cardigan, Cardigan Welsh corgi',
     'toy poodle',
     'miniature poodle',
     'standard poodle',
     'Mexican hairless',
     'timber wolf, grey wolf, gray wolf, Canis lupus',
     'white wolf, Arctic wolf, Canis lupus tundrarum',
     'red wolf, maned wolf, Canis rufus, Canis niger',
     'coyote, prairie wolf, brush wolf, Canis latrans',
     'dingo, warrigal, warragal, Canis dingo',
     'dhole, Cuon alpinus',
     'African hunting dog, hyena dog, Cape hunting dog, Lycaon pictus',
     'hyena, hyaena',
     'red fox, Vulpes vulpes',
     'kit fox, Vulpes macrotis',
     'Arctic fox, white fox, Alopex lagopus',
     'grey fox, gray fox, Urocyon cinereoargenteus',
     'tabby, tabby cat',
     'tiger cat',
     'Persian cat',
     'Siamese cat, Siamese',
     'Egyptian cat',
     'cougar, puma, catamount, mountain lion, painter, panther, Felis concolor',
     'lynx, catamount',
     'leopard, Panthera pardus',
     'snow leopard, ounce, Panthera uncia',
     'jaguar, panther, Panthera onca, Felis onca',
     'lion, king of beasts, Panthera leo',
     'tiger, Panthera tigris',
     'cheetah, chetah, Acinonyx jubatus',
     'brown bear, bruin, Ursus arctos',
     'American black bear, black bear, Ursus americanus, Euarctos americanus',
     'ice bear, polar bear, Ursus Maritimus, Thalarctos maritimus',
     'sloth bear, Melursus ursinus, Ursus ursinus',
     'mongoose',
     'meerkat, mierkat',
     'tiger beetle',
     'ladybug, ladybeetle, lady beetle, ladybird, ladybird beetle',
     'ground beetle, carabid beetle',
     'long-horned beetle, longicorn, longicorn beetle',
     'leaf beetle, chrysomelid',
     'dung beetle',
     'rhinoceros beetle',
     'weevil',
     'fly',
     'bee',
     'ant, emmet, pismire',
     'grasshopper, hopper',
     'cricket',
     'walking stick, walkingstick, stick insect',
     'cockroach, roach',
     'mantis, mantid',
     'cicada, cicala',
     'leafhopper',
     'lacewing, lacewing fly',
     "dragonfly, darning needle, devil's darning needle, sewing needle, snake feeder, snake doctor, mosquito hawk, skeeter hawk",
     'damselfly',
     'admiral',
     'ringlet, ringlet butterfly',
     'monarch, monarch butterfly, milkweed butterfly, Danaus plexippus',
     'cabbage butterfly',
     'sulphur butterfly, sulfur butterfly',
     'lycaenid, lycaenid butterfly',
     'starfish, sea star',
     'sea urchin',
     'sea cucumber, holothurian',
     'wood rabbit, cottontail, cottontail rabbit',
     'hare',
     'Angora, Angora rabbit',
     'hamster',
     'porcupine, hedgehog',
     'fox squirrel, eastern fox squirrel, Sciurus niger',
     'marmot',
     'beaver',
     'guinea pig, Cavia cobaya',
     'sorrel',
     'zebra',
     'hog, pig, grunter, squealer, Sus scrofa',
     'wild boar, boar, Sus scrofa',
     'warthog',
     'hippopotamus, hippo, river horse, Hippopotamus amphibius',
     'ox',
     'water buffalo, water ox, Asiatic buffalo, Bubalus bubalis',
     'bison',
     'ram, tup',
     'bighorn, bighorn sheep, cimarron, Rocky Mountain bighorn, Rocky Mountain sheep, Ovis canadensis',
     'ibex, Capra ibex',
     'hartebeest',
     'impala, Aepyceros melampus',
     'gazelle',
     'Arabian camel, dromedary, Camelus dromedarius',
     'llama',
     'weasel',
     'mink',
     'polecat, fitch, foulmart, foumart, Mustela putorius',
     'black-footed ferret, ferret, Mustela nigripes',
     'otter',
     'skunk, polecat, wood pussy',
     'badger',
     'armadillo',
     'three-toed sloth, ai, Bradypus tridactylus',
     'orangutan, orang, orangutang, Pongo pygmaeus',
     'gorilla, Gorilla gorilla',
     'chimpanzee, chimp, Pan troglodytes',
     'gibbon, Hylobates lar',
     'siamang, Hylobates syndactylus, Symphalangus syndactylus',
     'guenon, guenon monkey',
     'patas, hussar monkey, Erythrocebus patas',
     'baboon',
     'macaque',
     'langur',
     'colobus, colobus monkey',
     'proboscis monkey, Nasalis larvatus',
     'marmoset',
     'capuchin, ringtail, Cebus capucinus',
     'howler monkey, howler',
     'titi, titi monkey',
     'spider monkey, Ateles geoffroyi',
     'squirrel monkey, Saimiri sciureus',
     'Madagascar cat, ring-tailed lemur, Lemur catta',
     'indri, indris, Indri indri, Indri brevicaudatus',
     'Indian elephant, Elephas maximus',
     'African elephant, Loxodonta africana',
     'lesser panda, red panda, panda, bear cat, cat bear, Ailurus fulgens',
     'giant panda, panda, panda bear, coon bear, Ailuropoda melanoleuca',
     'barracouta, snoek',
     'eel',
     'coho, cohoe, coho salmon, blue jack, silver salmon, Oncorhynchus kisutch',
     'rock beauty, Holocanthus tricolor',
     'anemone fish',
     'sturgeon',
     'gar, garfish, garpike, billfish, Lepisosteus osseus',
     'lionfish',
     'puffer, pufferfish, blowfish, globefish',
     'abacus',
     'abaya',
     "academic gown, academic robe, judge's robe",
     'accordion, piano accordion, squeeze box',
     'acoustic guitar',
     'aircraft carrier, carrier, flattop, attack aircraft carrier',
     'airliner',
     'airship, dirigible',
     'altar',
     'ambulance',
     'amphibian, amphibious vehicle',
     'analog clock',
     'apiary, bee house',
     'apron',
     'ashcan, trash can, garbage can, wastebin, ash bin, ash-bin, ashbin, dustbin, trash barrel, trash bin',
     'assault rifle, assault gun',
     'backpack, back pack, knapsack, packsack, rucksack, haversack',
     'bakery, bakeshop, bakehouse',
     'balance beam, beam',
     'balloon',
     'ballpoint, ballpoint pen, ballpen, Biro',
     'Band Aid',
     'banjo',
     'bannister, banister, balustrade, balusters, handrail',
     'barbell',
     'barber chair',
     'barbershop',
     'barn',
     'barometer',
     'barrel, cask',
     'barrow, garden cart, lawn cart, wheelbarrow',
     'baseball',
     'basketball',
     'bassinet',
     'bassoon',
     'bathing cap, swimming cap',
     'bath towel',
     'bathtub, bathing tub, bath, tub',
     'beach wagon, station wagon, wagon, estate car, beach waggon, station waggon, waggon',
     'beacon, lighthouse, beacon light, pharos',
     'beaker',
     'bearskin, busby, shako',
     'beer bottle',
     'beer glass',
     'bell cote, bell cot',
     'bib',
     'bicycle-built-for-two, tandem bicycle, tandem',
     'bikini, two-piece',
     'binder, ring-binder',
     'binoculars, field glasses, opera glasses',
     'birdhouse',
     'boathouse',
     'bobsled, bobsleigh, bob',
     'bolo tie, bolo, bola tie, bola',
     'bonnet, poke bonnet',
     'bookcase',
     'bookshop, bookstore, bookstall',
     'bottlecap',
     'bow',
     'bow tie, bow-tie, bowtie',
     'brass, memorial tablet, plaque',
     'brassiere, bra, bandeau',
     'breakwater, groin, groyne, mole, bulwark, seawall, jetty',
     'breastplate, aegis, egis',
     'broom',
     'bucket, pail',
     'buckle',
     'bulletproof vest',
     'bullet train, bullet',
     'butcher shop, meat market',
     'cab, hack, taxi, taxicab',
     'caldron, cauldron',
     'candle, taper, wax light',
     'cannon',
     'canoe',
     'can opener, tin opener',
     'cardigan',
     'car mirror',
     'carousel, carrousel, merry-go-round, roundabout, whirligig',
     "carpenter's kit, tool kit",
     'carton',
     'car wheel',
     'cash machine, cash dispenser, automated teller machine, automatic teller machine, automated teller, automatic teller, ATM',
     'cassette',
     'cassette player',
     'castle',
     'catamaran',
     'CD player',
     'cello, violoncello',
     'cellular telephone, cellular phone, cellphone, cell, mobile phone',
     'chain',
     'chainlink fence',
     'chain mail, ring mail, mail, chain armor, chain armour, ring armor, ring armour',
     'chain saw, chainsaw',
     'chest',
     'chiffonier, commode',
     'chime, bell, gong',
     'china cabinet, china closet',
     'Christmas stocking',
     'church, church building',
     'cinema, movie theater, movie theatre, movie house, picture palace',
     'cleaver, meat cleaver, chopper',
     'cliff dwelling',
     'cloak',
     'clog, geta, patten, sabot',
     'cocktail shaker',
     'coffee mug',
     'coffeepot',
     'coil, spiral, volute, whorl, helix',
     'combination lock',
     'computer keyboard, keypad',
     'confectionery, confectionary, candy store',
     'container ship, containership, container vessel',
     'convertible',
     'corkscrew, bottle screw',
     'cornet, horn, trumpet, trump',
     'cowboy boot',
     'cowboy hat, ten-gallon hat',
     'cradle',
     'crane',
     'crash helmet',
     'crate',
     'crib, cot',
     'Crock Pot',
     'croquet ball',
     'crutch',
     'cuirass',
     'dam, dike, dyke',
     'desk',
     'desktop computer',
     'dial telephone, dial phone',
     'diaper, nappy, napkin',
     'digital clock',
     'digital watch',
     'dining table, board',
     'dishrag, dishcloth',
     'dishwasher, dish washer, dishwashing machine',
     'disk brake, disc brake',
     'dock, dockage, docking facility',
     'dogsled, dog sled, dog sleigh',
     'dome',
     'doormat, welcome mat',
     'drilling platform, offshore rig',
     'drum, membranophone, tympan',
     'drumstick',
     'dumbbell',
     'Dutch oven',
     'electric fan, blower',
     'electric guitar',
     'electric locomotive',
     'entertainment center',
     'envelope',
     'espresso maker',
     'face powder',
     'feather boa, boa',
     'file, file cabinet, filing cabinet',
     'fireboat',
     'fire engine, fire truck',
     'fire screen, fireguard',
     'flagpole, flagstaff',
     'flute, transverse flute',
     'folding chair',
     'football helmet',
     'forklift',
     'fountain',
     'fountain pen',
     'four-poster',
     'freight car',
     'French horn, horn',
     'frying pan, frypan, skillet',
     'fur coat',
     'garbage truck, dustcart',
     'gasmask, respirator, gas helmet',
     'gas pump, gasoline pump, petrol pump, island dispenser',
     'goblet',
     'go-kart',
     'golf ball',
     'golfcart, golf cart',
     'gondola',
     'gong, tam-tam',
     'gown',
     'grand piano, grand',
     'greenhouse, nursery, glasshouse',
     'grille, radiator grille',
     'grocery store, grocery, food market, market',
     'guillotine',
     'hair slide',
     'hair spray',
     'half track',
     'hammer',
     'hamper',
     'hand blower, blow dryer, blow drier, hair dryer, hair drier',
     'hand-held computer, hand-held microcomputer',
     'handkerchief, hankie, hanky, hankey',
     'hard disc, hard disk, fixed disk',
     'harmonica, mouth organ, harp, mouth harp',
     'harp',
     'harvester, reaper',
     'hatchet',
     'holster',
     'home theater, home theatre',
     'honeycomb',
     'hook, claw',
     'hoopskirt, crinoline',
     'horizontal bar, high bar',
     'horse cart, horse-cart',
     'hourglass',
     'iPod',
     'iron, smoothing iron',
     "jack-o'-lantern",
     'jean, blue jean, denim',
     'jeep, landrover',
     'jersey, T-shirt, tee shirt',
     'jigsaw puzzle',
     'jinrikisha, ricksha, rickshaw',
     'joystick',
     'kimono',
     'knee pad',
     'knot',
     'lab coat, laboratory coat',
     'ladle',
     'lampshade, lamp shade',
     'laptop, laptop computer',
     'lawn mower, mower',
     'lens cap, lens cover',
     'letter opener, paper knife, paperknife',
     'library',
     'lifeboat',
     'lighter, light, igniter, ignitor',
     'limousine, limo',
     'liner, ocean liner',
     'lipstick, lip rouge',
     'Loafer',
     'lotion',
     'loudspeaker, speaker, speaker unit, loudspeaker system, speaker system',
     "loupe, jeweler's loupe",
     'lumbermill, sawmill',
     'magnetic compass',
     'mailbag, postbag',
     'mailbox, letter box',
     'maillot',
     'maillot, tank suit',
     'manhole cover',
     'maraca',
     'marimba, xylophone',
     'mask',
     'matchstick',
     'maypole',
     'maze, labyrinth',
     'measuring cup',
     'medicine chest, medicine cabinet',
     'megalith, megalithic structure',
     'microphone, mike',
     'microwave, microwave oven',
     'military uniform',
     'milk can',
     'minibus',
     'miniskirt, mini',
     'minivan',
     'missile',
     'mitten',
     'mixing bowl',
     'mobile home, manufactured home',
     'Model T',
     'modem',
     'monastery',
     'monitor',
     'moped',
     'mortar',
     'mortarboard',
     'mosque',
     'mosquito net',
     'motor scooter, scooter',
     'mountain bike, all-terrain bike, off-roader',
     'mountain tent',
     'mouse, computer mouse',
     'mousetrap',
     'moving van',
     'muzzle',
     'nail',
     'neck brace',
     'necklace',
     'nipple',
     'notebook, notebook computer',
     'obelisk',
     'oboe, hautboy, hautbois',
     'ocarina, sweet potato',
     'odometer, hodometer, mileometer, milometer',
     'oil filter',
     'organ, pipe organ',
     'oscilloscope, scope, cathode-ray oscilloscope, CRO',
     'overskirt',
     'oxcart',
     'oxygen mask',
     'packet',
     'paddle, boat paddle',
     'paddlewheel, paddle wheel',
     'padlock',
     'paintbrush',
     "pajama, pyjama, pj's, jammies",
     'palace',
     'panpipe, pandean pipe, syrinx',
     'paper towel',
     'parachute, chute',
     'parallel bars, bars',
     'park bench',
     'parking meter',
     'passenger car, coach, carriage',
     'patio, terrace',
     'pay-phone, pay-station',
     'pedestal, plinth, footstall',
     'pencil box, pencil case',
     'pencil sharpener',
     'perfume, essence',
     'Petri dish',
     'photocopier',
     'pick, plectrum, plectron',
     'pickelhaube',
     'picket fence, paling',
     'pickup, pickup truck',
     'pier',
     'piggy bank, penny bank',
     'pill bottle',
     'pillow',
     'ping-pong ball',
     'pinwheel',
     'pirate, pirate ship',
     'pitcher, ewer',
     "plane, carpenter's plane, woodworking plane",
     'planetarium',
     'plastic bag',
     'plate rack',
     'plow, plough',
     "plunger, plumber's helper",
     'Polaroid camera, Polaroid Land camera',
     'pole',
     'police van, police wagon, paddy wagon, patrol wagon, wagon, black Maria',
     'poncho',
     'pool table, billiard table, snooker table',
     'pop bottle, soda bottle',
     'pot, flowerpot',
     "potter's wheel",
     'power drill',
     'prayer rug, prayer mat',
     'printer',
     'prison, prison house',
     'projectile, missile',
     'projector',
     'puck, hockey puck',
     'punching bag, punch bag, punching ball, punchball',
     'purse',
     'quill, quill pen',
     'quilt, comforter, comfort, puff',
     'racer, race car, racing car',
     'racket, racquet',
     'radiator',
     'radio, wireless',
     'radio telescope, radio reflector',
     'rain barrel',
     'recreational vehicle, RV, R.V.',
     'reel',
     'reflex camera',
     'refrigerator, icebox',
     'remote control, remote',
     'restaurant, eating house, eating place, eatery',
     'revolver, six-gun, six-shooter',
     'rifle',
     'rocking chair, rocker',
     'rotisserie',
     'rubber eraser, rubber, pencil eraser',
     'rugby ball',
     'rule, ruler',
     'running shoe',
     'safe',
     'safety pin',
     'saltshaker, salt shaker',
     'sandal',
     'sarong',
     'sax, saxophone',
     'scabbard',
     'scale, weighing machine',
     'school bus',
     'schooner',
     'scoreboard',
     'screen, CRT screen',
     'screw',
     'screwdriver',
     'seat belt, seatbelt',
     'sewing machine',
     'shield, buckler',
     'shoe shop, shoe-shop, shoe store',
     'shoji',
     'shopping basket',
     'shopping cart',
     'shovel',
     'shower cap',
     'shower curtain',
     'ski',
     'ski mask',
     'sleeping bag',
     'slide rule, slipstick',
     'sliding door',
     'slot, one-armed bandit',
     'snorkel',
     'snowmobile',
     'snowplow, snowplough',
     'soap dispenser',
     'soccer ball',
     'sock',
     'solar dish, solar collector, solar furnace',
     'sombrero',
     'soup bowl',
     'space bar',
     'space heater',
     'space shuttle',
     'spatula',
     'speedboat',
     "spider web, spider's web",
     'spindle',
     'sports car, sport car',
     'spotlight, spot',
     'stage',
     'steam locomotive',
     'steel arch bridge',
     'steel drum',
     'stethoscope',
     'stole',
     'stone wall',
     'stopwatch, stop watch',
     'stove',
     'strainer',
     'streetcar, tram, tramcar, trolley, trolley car',
     'stretcher',
     'studio couch, day bed',
     'stupa, tope',
     'submarine, pigboat, sub, U-boat',
     'suit, suit of clothes',
     'sundial',
     'sunglass',
     'sunglasses, dark glasses, shades',
     'sunscreen, sunblock, sun blocker',
     'suspension bridge',
     'swab, swob, mop',
     'sweatshirt',
     'swimming trunks, bathing trunks',
     'swing',
     'switch, electric switch, electrical switch',
     'syringe',
     'table lamp',
     'tank, army tank, armored combat vehicle, armoured combat vehicle',
     'tape player',
     'teapot',
     'teddy, teddy bear',
     'television, television system',
     'tennis ball',
     'thatch, thatched roof',
     'theater curtain, theatre curtain',
     'thimble',
     'thresher, thrasher, threshing machine',
     'throne',
     'tile roof',
     'toaster',
     'tobacco shop, tobacconist shop, tobacconist',
     'toilet seat',
     'torch',
     'totem pole',
     'tow truck, tow car, wrecker',
     'toyshop',
     'tractor',
     'trailer truck, tractor trailer, trucking rig, rig, articulated lorry, semi',
     'tray',
     'trench coat',
     'tricycle, trike, velocipede',
     'trimaran',
     'tripod',
     'triumphal arch',
     'trolleybus, trolley coach, trackless trolley',
     'trombone',
     'tub, vat',
     'turnstile',
     'typewriter keyboard',
     'umbrella',
     'unicycle, monocycle',
     'upright, upright piano',
     'vacuum, vacuum cleaner',
     'vase',
     'vault',
     'velvet',
     'vending machine',
     'vestment',
     'viaduct',
     'violin, fiddle',
     'volleyball',
     'waffle iron',
     'wall clock',
     'wallet, billfold, notecase, pocketbook',
     'wardrobe, closet, press',
     'warplane, military plane',
     'washbasin, handbasin, washbowl, lavabo, wash-hand basin',
     'washer, automatic washer, washing machine',
     'water bottle',
     'water jug',
     'water tower',
     'whiskey jug',
     'whistle',
     'wig',
     'window screen',
     'window shade',
     'Windsor tie',
     'wine bottle',
     'wing',
     'wok',
     'wooden spoon',
     'wool, woolen, woollen',
     'worm fence, snake fence, snake-rail fence, Virginia fence',
     'wreck',
     'yawl',
     'yurt',
     'web site, website, internet site, site',
     'comic book',
     'crossword puzzle, crossword',
     'street sign',
     'traffic light, traffic signal, stoplight',
     'book jacket, dust cover, dust jacket, dust wrapper',
     'menu',
     'plate',
     'guacamole',
     'consomme',
     'hot pot, hotpot',
     'trifle',
     'ice cream, icecream',
     'ice lolly, lolly, lollipop, popsicle',
     'French loaf',
     'bagel, beigel',
     'pretzel',
     'cheeseburger',
     'hotdog, hot dog, red hot',
     'mashed potato',
     'head cabbage',
     'broccoli',
     'cauliflower',
     'zucchini, courgette',
     'spaghetti squash',
     'acorn squash',
     'butternut squash',
     'cucumber, cuke',
     'artichoke, globe artichoke',
     'bell pepper',
     'cardoon',
     'mushroom',
     'Granny Smith',
     'strawberry',
     'orange',
     'lemon',
     'fig',
     'pineapple, ananas',
     'banana',
     'jackfruit, jak, jack',
     'custard apple',
     'pomegranate',
     'hay',
     'carbonara',
     'chocolate sauce, chocolate syrup',
     'dough',
     'meat loaf, meatloaf',
     'pizza, pizza pie',
     'potpie',
     'burrito',
     'red wine',
     'espresso',
     'cup',
     'eggnog',
     'alp',
     'bubble',
     'cliff, drop, drop-off',
     'coral reef',
     'geyser',
     'lakeside, lakeshore',
     'promontory, headland, head, foreland',
     'sandbar, sand bar',
     'seashore, coast, seacoast, sea-coast',
     'valley, vale',
     'volcano',
     'ballplayer, baseball player',
     'groom, bridegroom',
     'scuba diver',
     'rapeseed',
     'daisy',
     "yellow lady's slipper, yellow lady-slipper, Cypripedium calceolus, Cypripedium parviflorum",
     'corn',
     'acorn',
     'hip, rose hip, rosehip',
     'buckeye, horse chestnut, conker',
     'coral fungus',
     'agaric',
     'gyromitra',
     'stinkhorn, carrion fungus',
     'earthstar',
     'hen-of-the-woods, hen of the woods, Polyporus frondosus, Grifola frondosa',
     'bolete',
     'ear, spike, capitulum',
     'toilet tissue, toilet paper, bathroom tissue']

```python
len(imagenet_labels)
```

    1000

## Example image

We load our example image and make sure it's classified correctly.

```python
import numpy as np
import PIL
```

```python
img_path = Path("cat.jpg")
if not img_path.exists():
    img_path, _ = urlretrieve('https://www.anishathalye.com/media/2017/07/25/cat.jpg')
img_class = 281
imagenet_labels[img_class]
```

    'tabby, tabby cat'

```python
img = PIL.Image.open(img_path)
big_dim = max(img.width, img.height)
wide = img.width > img.height
new_w = 299 if not wide else int(img.width * 299 / img.height)
new_h = 299 if wide else int(img.height * 299 / img.width)
img = img.resize((new_w, new_h)).crop((0, 0, 299, 299))
img = (np.asarray(img) / 255.0).astype(np.float32)
img.shape
```

    (299, 299, 3)

```python
np.random.rand(7)[[1,3,5]]
```

    array([0.63593985, 0.62719905, 0.44864377])

list(range(7))[[1,3,5]]TypeError: list indices must be integers or slices, not list
It seems that `tf.Tensor`, like `list`, cannot access its subarray in this manner.

```python
p = inception_model(np.expand_dims(img, axis=0))[0]
p.shape
```

    TensorShape([1000])

p[[1,3,4]]InvalidArgumentError: Index out of range using input dim 1; input has only 1 dims [Op:StridedSlice] name: strided_slice/

```python
p.numpy()[[1,3,4]]
```

    array([7.1843247e-06, 2.1938207e-05, 1.8855206e-05], dtype=float32)

```python
def classify(img, correct_class=None, target_class=None):
    fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(10, 8))
    fig.sca(ax1)  # sca() Select Current Axis
    p = inception_model(np.expand_dims(img, axis=0))[0]
    p = p.numpy()
    print(f"type(p) = {type(p)}, len(p) = {len(p)}")
    ax1.imshow(img)
    #fig.sca(ax1)  # Why should there be two fig.sca(ax1)?

    # display the top 10 prediceted classes
    #topk = list(p.argsort()[-10:][::-1])
    #topk = list(tf.argsort(p)[-10:][::-1])
    topk = list((tf.argsort(p)[-10:][::-1]).numpy())
    print(f"topk = {topk}")
    topprobs = p[topk]
    barlist = ax2.bar(range(10), topprobs)
    if target_class in topk:
        barlist[topk.index(target_class)].set_color('r')
    if correct_class in topk:
        barlist[topk.index(correct_class)].set_color('g')
    plt.sca(ax2)
    plt.ylim([0, 1.1])
    plt.xticks(range(10),
               [imagenet_labels[i][:15] for i in topk],
               rotation='vertical')
    # :15 means "taking the first 15 characters" for fear of long-string class.
    fig.subplots_adjust(bottom=0.2)
    plt.show()
```
help(np.expand_dims)
**(?)** What is the `new_w, new_h, resize()` all about?<br>
**(R)** The story was that Anish wanted to `crop((0,0,299,299))`, i.e. crop the `299x299` subimage for the upper left corner for each image. But the reality is that _**not every image has both width and height larger than**_ `299`. So the `resize((new_w, new_h))` was there to guarantee this. Indeed,
\begin{align}
  h_{\text{new}} = 299,\;  w_{\text{new}} = h_{\text{new}} \frac{w}{h} \quad\text{when}\quad h < w \\
  w_{\text{new}} = 299,\;  h_{\text{new}} = w_{\text{new}} \frac{h}{w} \quad\text{when}\quad h \ge w
\end{align}

which converted into words says **_always convert the shorter side to_** `299` and **_the longer side to its rightful length according to the original ratio_**.

```python
%matplotlib inline
import matplotlib.pyplot as plt
import matplotlib as mpl
```

```python
mpl.rc('axes', labelsize=14)
mpl.rc('xtick', labelsize=12)
mpl.rc('ytick', labelsize=12)

DARK_READER = True
if DARK_READER:
    plt.rcParams.update({
        "lines.color": "white",
        "patch.edgecolor": "white",
        "text.color": "black",
        "axes.facecolor": "black",
        "axes.edgecolor": "lightgray",
        "axes.labelcolor": "white",
        "axes.titlecolor": "white",
        "xtick.color": "white",
        "ytick.color": "white",
        "grid.color": "lightgray",
        "figure.facecolor": "black",
        "figure.edgecolor": "black",
        "savefig.facecolor": "black",
        "savefig.edgecolor": "black",
    })
```

```python
classify(img, correct_class=img_class)
```

```python

```

# Adversarial examples

Given an image $\mathbf{x}$, our neural network outputs a probability distribution over labels, $P(y \mid \mathbf{x})$. When we craft an adversarial input, we want to find an $\hat{\mathbf{x}}$ where $\log P(\hat{y} \mid \hat{\mathbf{x}})$ is maximized for a target label $\hat{y}$: that way, our input will be misclassified as the target class. We can ensure that $\hat{\mathbf{x}}$ doesn't look too different from the original $\mathbf{x}$ by constraining ourselves to some $\ell_\infty$ <del>box</del> ball with radius $\epsilon$, requiring that $\left\lVert \mathbf{x} - \hat{\mathbf{x}} \right\rVert_\infty \le \epsilon$.

In this framework, an adversarial example is the solution to a constrained optimization problem that we can solve using [backpropagation](https://colah.github.io/posts/2015-08-Backprop/) and projected gradient descent, basically the same techniques that are used to train networks themselves. The algorithm is simple:

We begin by initializing our adversarial example as $\hat{\mathbf{x}} \leftarrow \mathbf{x}$. Then, we repeat the following until convergence:

1. $\hat{\mathbf{x}} \leftarrow \hat{\mathbf{x}} + \alpha \cdot \nabla \log P(\hat{y} \mid \hat{\mathbf{x}})$
2. $\hat{\mathbf{x}} \leftarrow \mathrm{clip}(\hat{\mathbf{x}}, \mathbf{x} - \epsilon, \mathbf{x} + \epsilon)$

```python
demo_epsilon = 2.0/255.0 # a really small perturbation
demo_lr = 1e-1
demo_steps = 100
demo_target = 924 # "guacamole"
# Test other target classes at your own will
demo_target = imagenet_labels.index("pizza, pizza pie")

# initialization step
#sess.run(assign_op, feed_dict={x: img})
x_hat = image

# projected gradient descent
for i in tqdm(range(demo_steps)):
    ## gradient descent step
    #_, loss_value = sess.run(
    #    [optim_step, loss],
    #    feed_dict={learning_rate: demo_lr, y_hat: demo_target})
    ## project step
    #sess.run(project_step, feed_dict={x: img, epsilon: demo_epsilon})
    with tf.GradientTape() as tape:
        log_likelihood =
    if (i+1) % 10 == 0:
        print('step %d, loss=%g' % (i+1, loss_value))
```

## Continue in `v2.ipynb`
I would like to wrap `p = inception_model(np.expand_dims(img, axis=0))[0]` inside another function named `inception()` (we might have to replace `np.expand_dims()` by `tf.expand_dims()`)

```python

```