How to get google AutoML model coefficients

不问归期 提交于 2021-01-29 20:11:06

问题


I am new to the google AutoML, once I trained a model, I want to see the model details, i.e. feature factors and the related coefficients. Any suggestions?


回答1:


Assuming you are talking about an AutoML Vision model (both classification or object detection work similar): You can choose to train an edge model when starting the training. This enables you to download the model afterwards as TensorFlow saved_model.pb.

With this, you could then e.g. use Netron to visualize the network. Or you can load the model with Python and print details about it with some code like:

import tensorflow as tf

path_mdl = "input/model" # folder to file with saved_model.pb

with tf.Session(graph=tf.Graph()) as sess:
    tf.saved_model.loader.load(sess, ["serve"], path_mdl)

    graph = tf.get_default_graph()

    # print input and output operations
    graph.get_operations()

    # print infos about all nodes
    weight_nodes = [n for n in graph_def.node if n.op == 'Const']
    for n in weight_nodes:
        print("Name of the node - %s" % n.name)
        print("Value - " )
        print(tensor_util.MakeNdarray(n.attr['value'].tensor))


来源:https://stackoverflow.com/questions/57340630/how-to-get-google-automl-model-coefficients

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!