google / model_search

Apache License 2.0
3.27k stars 460 forks source link

Neural Network Architecture Details #54

Open gnaven opened 3 years ago

gnaven commented 3 years ago

I ran the default setting on my dataset and I am trying to figure out what the architecture of the model looks like (i.e how many layers, its size) and what Hyperparameter values did it choose. Where could I find this information?

CyFeng16 commented 3 years ago

/tmp/run_example/tune-1/xxx/saved_model according to your root_dir config.

Gazi Mahir Ahmed Naven @.***> 于2021年4月17日周六 上午2:49写道:

I ran the default setting on my dataset and I am trying to figure out what the architecture of the model looks like (i.e how many layers, its size) and what Hyperparameter values did it choose. Where could I find this information?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/google/model_search/issues/54, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHDIKHMJCQ3O4B2CSRHI4ZDTJCBE7ANCNFSM43CBKITA .

malekinho8 commented 3 years ago

@CyFeng16 You cannot load the saved_model.pb file into keras and see things like model.summary( ), and other characteristics of the neural network. I am still confused as to where that information can be found. I used Tensorboard to view the contents of the saved_model directory, but it's still not clear where any relevant information about the neural network can be readily found.

JoshuaMathew commented 3 years ago

@gnaven you can run the following code to see the different blocks in the model and their shape:

import tensorflow as tf
loaded = tf.saved_model.load('path_to_model')
model = loaded.signatures['serving_default']

for v in model.trainable_variables:
    if 'kernel' in v.name:
        print(v.name.split('/')[2])
        print('Shape: ' + str(v.shape))

The blocks are defined in model_search/blocks.py