苗条地在alexne.py中看到了它,找不到此文档。想知道什么是收藏?我猜它是一种容器,在这种情况下,它将用于输出节点?并想知道这样做的目的是什么,而不是使用输出的名称。
with tf.variable_scope(scope, 'alexnet_v2', [inputs]) as sc:
end_points_collection = sc.name + '_end_points'
with slim.arg_scope([slim.conv2d, slim.fully_connected, slim.max_pool2d],
outputs_collections=[end_points_collection]):
net = slim.conv2d(inputs, 64, [11,11], 4, padding = 'VALID', scope ='conv1')
Run Code Online (Sandbox Code Playgroud)
集合只是容器,用于对具有相似含义的图节点进行分组。
假设任何新的可训练对象Variable都放置在名为trainable_variables的集合中,可以使用进行访问tf.get_collection('trainable_variables')。
同样,您可以为该层的输出传递一个集合。
| 归档时间: |
|
| 查看次数: |
1474 次 |
| 最近记录: |