我是谷歌AutoML的新手,一旦我训练了一个模型,我想看看模型的细节,即特征因子和相关系数。有什么建议吗?
发布于 2019-11-07 04:51:18
假设您正在谈论AutoML视觉模型(分类或目标检测工作类似):您可以选择在开始训练时训练边缘模型。这使您能够在以后以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))https://stackoverflow.com/questions/57340630
复制相似问题