【问题标题】:How to get google AutoML model coefficients如何获取谷歌 AutoML 模型系数
【发布时间】:2019-11-08 07:15:28
【问题描述】:

我是 google AutoML 的新手,一旦我训练了一个模型,我想查看模型的详细信息,即特征因子和相关系数。有什么建议吗?

【问题讨论】:

    标签: google-cloud-automl


    【解决方案1】:

    假设您谈论的是 AutoML Vision 模型(分类或对象检测工作类似):您可以在开始训练时选择训练 edge 模型。这使您之后可以将模型下载为 TensorFlow saved_model.pb

    有了这个,你可以然后例如使用Netron 可视化网络。或者,您可以使用 Python 加载模型并使用以下代码打印有关它的详细信息:

    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))
    

    【讨论】:

      猜你喜欢
      • 2020-11-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-30
      • 1970-01-01
      • 1970-01-01
      • 2020-01-14
      相关资源
      最近更新 更多