1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
| # ===================从此处修改预测层的代码============================ for index, from_layer in enumerate(feature_map_layout['from_layer']): layer_depth = feature_map_layout['layer_depth'][index] conv_kernel_size = 3 if 'conv_kernel_size' in feature_map_layout: conv_kernel_size = feature_map_layout['conv_kernel_size'][index] if from_layer: feature_map = image_features[from_layer] if from_layer == "layer_8/expansion_output": # feature_map = image_features[from_layer] layer_19_1x1 = slim.conv2d( image_features['layer_19'], 256, [1, 1], padding='SAME', stride=1, scope='layer_19_1x1') layer_19_1x1_upsample = ops.nearest_neighbor_upsampling(layer_19_1x1, 2) layer_15_1x1 = slim.conv2d( image_features['layer_15/expansion_output'], 256, [1, 1], padding='SAME', stride=1, scope='layer_15_1x1') layer_15_19 = layer_15_1x1 + layer_19_1x1_upsample layer_15_19_upsample = ops.nearest_neighbor_upsampling(layer_15_19, 2) feature_map = slim.conv2d( feature_map, 256, [1, 1], padding='SAME', stride=1, scope='layer_8_expansion_output_1x1') feature_map = feature_map + layer_15_19_upsample if from_layer == "layer_19": layer_15_1x1_2 = slim.conv2d( image_features['layer_15/expansion_output'], 512, [1, 1], padding='SAME', stride=1, scope='layer_15_1x1_2') layer_15_passthrough= slim.max_pool2d( layer_15_1x1_2, [2, 2], scope='passthrough_pool') feature_map= slim.conv2d( feature_map, 512, [1, 1], padding='SAME', stride=1, scope='layer_19_layer_15_passthrough_1x1') feature_map = feature_map + layer_15_passthrough
base_from_layer = from_layer feature_map_keys.append(from_layer) else:
|