A problem about the NvBufSurfTransform

When I executed caffe model with deepstream, the following error occurred.

0:00:01.250098520 10261     0x32740cd0 WARN                 nvinfer gstnvinfer.cpp:523:gst_nvinfer_logger:<primary_gie_classifier> NvDsInferContext[UID 1]:log(): Using an engine plan file across different models of devices is not recommended and is likely to affect performance or even cause errors.

Runtime commands:
	h: Print this help
	q: Quit

	p: Pause
	r: Resume

**PERF: FPS 0 (Avg)	
**PERF: 0.00 (0.00)	
** INFO: <bus_callback:189>: Pipeline ready

Opening in BLOCKING MODE 
NvMMLiteOpen : Block : BlockType = 261 
NVMEDIA: Reading vendor.tegra.display-size : status: 6 
NvMMLiteBlockCreate : Block : BlockType = 261 
** INFO: <bus_callback:175>: Pipeline running

Creating LL OSD context new
0:00:05.287065975 10261     0x32336770 WARN                 nvinfer gstnvinfer.cpp:1157:convert_batch_and_push_to_input_thread:<primary_gie_classifier> error: NvBufSurfTransform failed with error -2 while converting buffer
ERROR from primary_gie_classifier: NvBufSurfTransform failed with error -2 while converting buffer
Debug info: gstnvinfer.cpp(1157): convert_batch_and_push_to_input_thread (): /GstPipeline:pipeline/GstBin:primary_gie_bin/GstNvInfer:primary_gie_classifier
ERROR from qtdemux0: Internal data stream error.
Debug info: qtdemux.c(6073): gst_qtdemux_loop (): /GstPipeline:pipeline/GstBin:multi_src_bin/GstBin:src_sub_bin0/GstURIDecodeBin:src_elem/GstDecodeBin:decodebin0/GstQTDemux:qtdemux0:
streaming stopped, reason error (-5)
Quitting
App run failed

The code in the function “convert_batch_and_push_to_input_thread” of the gstnvinfer.cpp

err = NvBufSurfTransform (&nvinfer->tmp_surf, mem->surf,
            &nvinfer->transform_params);

my caffe prototxt is

layer {
  name: "input_1"
  type: "Input"
  top: "input_1"
  input_param {
    shape: { dim: 1 dim: 3 dim: 112 dim: 112 }
  }
}

layer {
	bottom: "input_1"
	top: "conv_1_conv2d"
	name: "conv_1_conv2d"
	type: "Convolution"
	convolution_param {
		num_output: 64
		kernel_size: 3
		pad: 1
		stride: 2
		bias_term: false
	}
}

layer {
  bottom: "conv_1_conv2d"
  top: "conv_1_batchnorm"
  name: "conv_1_batchnorm"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 0.001
  }
}
layer {
  bottom: "conv_1_batchnorm"
  top: "conv_1_batchnorm"
  name: "conv_1_batchnorm_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
  bottom: "conv_1_batchnorm"
  top: "conv_1_relu"
  name: "conv_1_relu"
  type: "ReLU"
}

layer {
	bottom: "conv_1_relu"
	top: "conv_2_dw_conv2d"
	name: "conv_2_dw_conv2d"
	type: "Convolution"
	convolution_param {
		num_output: 64
		kernel_size: 3
		pad: 1
		group: 64
            engine:CAFFE
		stride: 1
		bias_term: false
	}
}

layer {
  bottom: "conv_2_dw_conv2d"
  top: "conv_2_dw_batchnorm"
  name: "conv_2_dw_batchnorm"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 0.001
  }
}
layer {
  bottom: "conv_2_dw_batchnorm"
  top: "conv_2_dw_batchnorm"
  name: "conv_2_dw_batchnorm_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
  bottom: "conv_2_dw_batchnorm"
  top: "conv_2_dw_relu"
  name: "conv_2_dw_relu"
  type: "ReLU"
}

layer {
	bottom: "conv_2_dw_relu"
	top: "dconv_23_conv_sep_conv2d"
	name: "dconv_23_conv_sep_conv2d"
	type: "Convolution"
	convolution_param {
		num_output: 128
		kernel_size: 1
		pad: 0
		stride: 1
		bias_term: false
	}
}

layer {
  bottom: "dconv_23_conv_sep_conv2d"
  top: "dconv_23_conv_sep_batchnorm"
  name: "dconv_23_conv_sep_batchnorm"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 0.001
  }
}
layer {
  bottom: "dconv_23_conv_sep_batchnorm"
  top: "dconv_23_conv_sep_batchnorm"
  name: "dconv_23_conv_sep_batchnorm_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
  bottom: "dconv_23_conv_sep_batchnorm"
  top: "dconv_23_conv_sep_relu"
  name: "dconv_23_conv_sep_relu"
  type: "ReLU"
}

layer {
	bottom: "dconv_23_conv_sep_relu"
	top: "dconv_23_conv_dw_conv2d"
	name: "dconv_23_conv_dw_conv2d"
	type: "Convolution"
	convolution_param {
		num_output: 128
		kernel_size: 3
		pad: 1
		group: 128
            engine:CAFFE
		stride: 2
		bias_term: false
	}
}

layer {
  bottom: "dconv_23_conv_dw_conv2d"
  top: "dconv_23_conv_dw_batchnorm"
  name: "dconv_23_conv_dw_batchnorm"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 0.001
  }
}
layer {
  bottom: "dconv_23_conv_dw_batchnorm"
  top: "dconv_23_conv_dw_batchnorm"
  name: "dconv_23_conv_dw_batchnorm_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
  bottom: "dconv_23_conv_dw_batchnorm"
  top: "dconv_23_conv_dw_relu"
  name: "dconv_23_conv_dw_relu"
  type: "ReLU"
}

layer {
	bottom: "dconv_23_conv_dw_relu"
	top: "dconv_23_conv_proj_conv2d"
	name: "dconv_23_conv_proj_conv2d"
	type: "Convolution"
	convolution_param {
		num_output: 64
		kernel_size: 1
		pad: 0
		stride: 1
		bias_term: false
	}
}

layer {
  bottom: "dconv_23_conv_proj_conv2d"
  top: "dconv_23_conv_proj_batchnorm"
  name: "dconv_23_conv_proj_batchnorm"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 0.001
  }
}
layer {
  bottom: "dconv_23_conv_proj_batchnorm"
  top: "dconv_23_conv_proj_batchnorm"
  name: "dconv_23_conv_proj_batchnorm_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
	bottom: "dconv_23_conv_proj_batchnorm"
	top: "res_3_block0_conv_sep_conv2d"
	name: "res_3_block0_conv_sep_conv2d"
	type: "Convolution"
	convolution_param {
		num_output: 128
		kernel_size: 1
		pad: 0
		stride: 1
		bias_term: false
	}
}

layer {
  bottom: "res_3_block0_conv_sep_conv2d"
  top: "res_3_block0_conv_sep_batchnorm"
  name: "res_3_block0_conv_sep_batchnorm"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 0.001
  }
}
layer {
  bottom: "res_3_block0_conv_sep_batchnorm"
  top: "res_3_block0_conv_sep_batchnorm"
  name: "res_3_block0_conv_sep_batchnorm_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
  bottom: "res_3_block0_conv_sep_batchnorm"
  top: "res_3_block0_conv_sep_relu"
  name: "res_3_block0_conv_sep_relu"
  type: "ReLU"
}

layer {
	bottom: "res_3_block0_conv_sep_relu"
	top: "res_3_block0_conv_dw_conv2d"
	name: "res_3_block0_conv_dw_conv2d"
	type: "Convolution"
	convolution_param {
		num_output: 128
		kernel_size: 3
		pad: 1
		group: 128
            engine:CAFFE
		stride: 1
		bias_term: false
	}
}

layer {
  bottom: "res_3_block0_conv_dw_conv2d"
  top: "res_3_block0_conv_dw_batchnorm"
  name: "res_3_block0_conv_dw_batchnorm"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 0.001
  }
}
layer {
  bottom: "res_3_block0_conv_dw_batchnorm"
  top: "res_3_block0_conv_dw_batchnorm"
  name: "res_3_block0_conv_dw_batchnorm_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
  bottom: "res_3_block0_conv_dw_batchnorm"
  top: "res_3_block0_conv_dw_relu"
  name: "res_3_block0_conv_dw_relu"
  type: "ReLU"
}

layer {
	bottom: "res_3_block0_conv_dw_relu"
	top: "res_3_block0_conv_proj_conv2d"
	name: "res_3_block0_conv_proj_conv2d"
	type: "Convolution"
	convolution_param {
		num_output: 64
		kernel_size: 1
		pad: 0
		stride: 1
		bias_term: false
	}
}

layer {
  bottom: "res_3_block0_conv_proj_conv2d"
  top: "res_3_block0_conv_proj_batchnorm"
  name: "res_3_block0_conv_proj_batchnorm"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 0.001
  }
}
layer {
  bottom: "res_3_block0_conv_proj_batchnorm"
  top: "res_3_block0_conv_proj_batchnorm"
  name: "res_3_block0_conv_proj_batchnorm_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
  name: "_plus0"
  type: "Eltwise"
  bottom: "res_3_block0_conv_proj_batchnorm"
  bottom: "dconv_23_conv_proj_batchnorm"
  top: "_plus0"
  eltwise_param { operation: SUM }
}

layer {
	bottom: "_plus0"
	top: "res_3_block1_conv_sep_conv2d"
	name: "res_3_block1_conv_sep_conv2d"
	type: "Convolution"
	convolution_param {
		num_output: 128
		kernel_size: 1
		pad: 0
		stride: 1
		bias_term: false
	}
}

layer {
  bottom: "res_3_block1_conv_sep_conv2d"
  top: "res_3_block1_conv_sep_batchnorm"
  name: "res_3_block1_conv_sep_batchnorm"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 0.001
  }
}
layer {
  bottom: "res_3_block1_conv_sep_batchnorm"
  top: "res_3_block1_conv_sep_batchnorm"
  name: "res_3_block1_conv_sep_batchnorm_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
  bottom: "res_3_block1_conv_sep_batchnorm"
  top: "res_3_block1_conv_sep_relu"
  name: "res_3_block1_conv_sep_relu"
  type: "ReLU"
}

layer {
	bottom: "res_3_block1_conv_sep_relu"
	top: "res_3_block1_conv_dw_conv2d"
	name: "res_3_block1_conv_dw_conv2d"
	type: "Convolution"
	convolution_param {
		num_output: 128
		kernel_size: 3
		pad: 1
		group: 128
            engine:CAFFE
		stride: 1
		bias_term: false
	}
}

layer {
  bottom: "res_3_block1_conv_dw_conv2d"
  top: "res_3_block1_conv_dw_batchnorm"
  name: "res_3_block1_conv_dw_batchnorm"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 0.001
  }
}
layer {
  bottom: "res_3_block1_conv_dw_batchnorm"
  top: "res_3_block1_conv_dw_batchnorm"
  name: "res_3_block1_conv_dw_batchnorm_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
  bottom: "res_3_block1_conv_dw_batchnorm"
  top: "res_3_block1_conv_dw_relu"
  name: "res_3_block1_conv_dw_relu"
  type: "ReLU"
}

layer {
	bottom: "res_3_block1_conv_dw_relu"
	top: "res_3_block1_conv_proj_conv2d"
	name: "res_3_block1_conv_proj_conv2d"
	type: "Convolution"
	convolution_param {
		num_output: 64
		kernel_size: 1
		pad: 0
		stride: 1
		bias_term: false
	}
}

layer {
  bottom: "res_3_block1_conv_proj_conv2d"
  top: "res_3_block1_conv_proj_batchnorm"
  name: "res_3_block1_conv_proj_batchnorm"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 0.001
  }
}
layer {
  bottom: "res_3_block1_conv_proj_batchnorm"
  top: "res_3_block1_conv_proj_batchnorm"
  name: "res_3_block1_conv_proj_batchnorm_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
  name: "_plus1"
  type: "Eltwise"
  bottom: "res_3_block1_conv_proj_batchnorm"
  bottom: "_plus0"
  top: "_plus1"
  eltwise_param { operation: SUM }
}

layer {
	bottom: "_plus1"
	top: "res_3_block2_conv_sep_conv2d"
	name: "res_3_block2_conv_sep_conv2d"
	type: "Convolution"
	convolution_param {
		num_output: 128
		kernel_size: 1
		pad: 0
		stride: 1
		bias_term: false
	}
}

layer {
  bottom: "res_3_block2_conv_sep_conv2d"
  top: "res_3_block2_conv_sep_batchnorm"
  name: "res_3_block2_conv_sep_batchnorm"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 0.001
  }
}
layer {
  bottom: "res_3_block2_conv_sep_batchnorm"
  top: "res_3_block2_conv_sep_batchnorm"
  name: "res_3_block2_conv_sep_batchnorm_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
  bottom: "res_3_block2_conv_sep_batchnorm"
  top: "res_3_block2_conv_sep_relu"
  name: "res_3_block2_conv_sep_relu"
  type: "ReLU"
}

layer {
	bottom: "res_3_block2_conv_sep_relu"
	top: "res_3_block2_conv_dw_conv2d"
	name: "res_3_block2_conv_dw_conv2d"
	type: "Convolution"
	convolution_param {
		num_output: 128
		kernel_size: 3
		pad: 1
		group: 128
            engine:CAFFE
		stride: 1
		bias_term: false
	}
}

layer {
  bottom: "res_3_block2_conv_dw_conv2d"
  top: "res_3_block2_conv_dw_batchnorm"
  name: "res_3_block2_conv_dw_batchnorm"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 0.001
  }
}
layer {
  bottom: "res_3_block2_conv_dw_batchnorm"
  top: "res_3_block2_conv_dw_batchnorm"
  name: "res_3_block2_conv_dw_batchnorm_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
  bottom: "res_3_block2_conv_dw_batchnorm"
  top: "res_3_block2_conv_dw_relu"
  name: "res_3_block2_conv_dw_relu"
  type: "ReLU"
}

layer {
	bottom: "res_3_block2_conv_dw_relu"
	top: "res_3_block2_conv_proj_conv2d"
	name: "res_3_block2_conv_proj_conv2d"
	type: "Convolution"
	convolution_param {
		num_output: 64
		kernel_size: 1
		pad: 0
		stride: 1
		bias_term: false
	}
}

layer {
  bottom: "res_3_block2_conv_proj_conv2d"
  top: "res_3_block2_conv_proj_batchnorm"
  name: "res_3_block2_conv_proj_batchnorm"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 0.001
  }
}
layer {
  bottom: "res_3_block2_conv_proj_batchnorm"
  top: "res_3_block2_conv_proj_batchnorm"
  name: "res_3_block2_conv_proj_batchnorm_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
  name: "_plus2"
  type: "Eltwise"
  bottom: "res_3_block2_conv_proj_batchnorm"
  bottom: "_plus1"
  top: "_plus2"
  eltwise_param { operation: SUM }
}

layer {
	bottom: "_plus2"
	top: "res_3_block3_conv_sep_conv2d"
	name: "res_3_block3_conv_sep_conv2d"
	type: "Convolution"
	convolution_param {
		num_output: 128
		kernel_size: 1
		pad: 0
		stride: 1
		bias_term: false
	}
}

layer {
  bottom: "res_3_block3_conv_sep_conv2d"
  top: "res_3_block3_conv_sep_batchnorm"
  name: "res_3_block3_conv_sep_batchnorm"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 0.001
  }
}
layer {
  bottom: "res_3_block3_conv_sep_batchnorm"
  top: "res_3_block3_conv_sep_batchnorm"
  name: "res_3_block3_conv_sep_batchnorm_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
  bottom: "res_3_block3_conv_sep_batchnorm"
  top: "res_3_block3_conv_sep_relu"
  name: "res_3_block3_conv_sep_relu"
  type: "ReLU"
}

layer {
	bottom: "res_3_block3_conv_sep_relu"
	top: "res_3_block3_conv_dw_conv2d"
	name: "res_3_block3_conv_dw_conv2d"
	type: "Convolution"
	convolution_param {
		num_output: 128
		kernel_size: 3
		pad: 1
		group: 128
            engine:CAFFE
		stride: 1
		bias_term: false
	}
}

layer {
  bottom: "res_3_block3_conv_dw_conv2d"
  top: "res_3_block3_conv_dw_batchnorm"
  name: "res_3_block3_conv_dw_batchnorm"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 0.001
  }
}
layer {
  bottom: "res_3_block3_conv_dw_batchnorm"
  top: "res_3_block3_conv_dw_batchnorm"
  name: "res_3_block3_conv_dw_batchnorm_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
  bottom: "res_3_block3_conv_dw_batchnorm"
  top: "res_3_block3_conv_dw_relu"
  name: "res_3_block3_conv_dw_relu"
  type: "ReLU"
}

layer {
	bottom: "res_3_block3_conv_dw_relu"
	top: "res_3_block3_conv_proj_conv2d"
	name: "res_3_block3_conv_proj_conv2d"
	type: "Convolution"
	convolution_param {
		num_output: 64
		kernel_size: 1
		pad: 0
		stride: 1
		bias_term: false
	}
}

layer {
  bottom: "res_3_block3_conv_proj_conv2d"
  top: "res_3_block3_conv_proj_batchnorm"
  name: "res_3_block3_conv_proj_batchnorm"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 0.001
  }
}
layer {
  bottom: "res_3_block3_conv_proj_batchnorm"
  top: "res_3_block3_conv_proj_batchnorm"
  name: "res_3_block3_conv_proj_batchnorm_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
  name: "_plus3"
  type: "Eltwise"
  bottom: "res_3_block3_conv_proj_batchnorm"
  bottom: "_plus2"
  top: "_plus3"
  eltwise_param { operation: SUM }
}

layer {
	bottom: "_plus3"
	top: "dconv_34_conv_sep_conv2d"
	name: "dconv_34_conv_sep_conv2d"
	type: "Convolution"
	convolution_param {
		num_output: 256
		kernel_size: 1
		pad: 0
		stride: 1
		bias_term: false
	}
}

layer {
  bottom: "dconv_34_conv_sep_conv2d"
  top: "dconv_34_conv_sep_batchnorm"
  name: "dconv_34_conv_sep_batchnorm"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 0.001
  }
}
layer {
  bottom: "dconv_34_conv_sep_batchnorm"
  top: "dconv_34_conv_sep_batchnorm"
  name: "dconv_34_conv_sep_batchnorm_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
  bottom: "dconv_34_conv_sep_batchnorm"
  top: "dconv_34_conv_sep_relu"
  name: "dconv_34_conv_sep_relu"
  type: "ReLU"
}

layer {
	bottom: "dconv_34_conv_sep_relu"
	top: "dconv_34_conv_dw_conv2d"
	name: "dconv_34_conv_dw_conv2d"
	type: "Convolution"
	convolution_param {
		num_output: 256
		kernel_size: 3
		pad: 1
		group: 256
            engine:CAFFE
		stride: 2
		bias_term: false
	}
}

layer {
  bottom: "dconv_34_conv_dw_conv2d"
  top: "dconv_34_conv_dw_batchnorm"
  name: "dconv_34_conv_dw_batchnorm"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 0.001
  }
}
layer {
  bottom: "dconv_34_conv_dw_batchnorm"
  top: "dconv_34_conv_dw_batchnorm"
  name: "dconv_34_conv_dw_batchnorm_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
  bottom: "dconv_34_conv_dw_batchnorm"
  top: "dconv_34_conv_dw_relu"
  name: "dconv_34_conv_dw_relu"
  type: "ReLU"
}

layer {
	bottom: "dconv_34_conv_dw_relu"
	top: "dconv_34_conv_proj_conv2d"
	name: "dconv_34_conv_proj_conv2d"
	type: "Convolution"
	convolution_param {
		num_output: 128
		kernel_size: 1
		pad: 0
		stride: 1
		bias_term: false
	}
}

layer {
  bottom: "dconv_34_conv_proj_conv2d"
  top: "dconv_34_conv_proj_batchnorm"
  name: "dconv_34_conv_proj_batchnorm"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 0.001
  }
}
layer {
  bottom: "dconv_34_conv_proj_batchnorm"
  top: "dconv_34_conv_proj_batchnorm"
  name: "dconv_34_conv_proj_batchnorm_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
	bottom: "dconv_34_conv_proj_batchnorm"
	top: "res_4_block0_conv_sep_conv2d"
	name: "res_4_block0_conv_sep_conv2d"
	type: "Convolution"
	convolution_param {
		num_output: 256
		kernel_size: 1
		pad: 0
		stride: 1
		bias_term: false
	}
}

layer {
  bottom: "res_4_block0_conv_sep_conv2d"
  top: "res_4_block0_conv_sep_batchnorm"
  name: "res_4_block0_conv_sep_batchnorm"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 0.001
  }
}
layer {
  bottom: "res_4_block0_conv_sep_batchnorm"
  top: "res_4_block0_conv_sep_batchnorm"
  name: "res_4_block0_conv_sep_batchnorm_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
  bottom: "res_4_block0_conv_sep_batchnorm"
  top: "res_4_block0_conv_sep_relu"
  name: "res_4_block0_conv_sep_relu"
  type: "ReLU"
}

layer {
	bottom: "res_4_block0_conv_sep_relu"
	top: "res_4_block0_conv_dw_conv2d"
	name: "res_4_block0_conv_dw_conv2d"
	type: "Convolution"
	convolution_param {
		num_output: 256
		kernel_size: 3
		pad: 1
		group: 256
            engine:CAFFE
		stride: 1
		bias_term: false
	}
}

layer {
  bottom: "res_4_block0_conv_dw_conv2d"
  top: "res_4_block0_conv_dw_batchnorm"
  name: "res_4_block0_conv_dw_batchnorm"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 0.001
  }
}
layer {
  bottom: "res_4_block0_conv_dw_batchnorm"
  top: "res_4_block0_conv_dw_batchnorm"
  name: "res_4_block0_conv_dw_batchnorm_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
  bottom: "res_4_block0_conv_dw_batchnorm"
  top: "res_4_block0_conv_dw_relu"
  name: "res_4_block0_conv_dw_relu"
  type: "ReLU"
}

layer {
	bottom: "res_4_block0_conv_dw_relu"
	top: "res_4_block0_conv_proj_conv2d"
	name: "res_4_block0_conv_proj_conv2d"
	type: "Convolution"
	convolution_param {
		num_output: 128
		kernel_size: 1
		pad: 0
		stride: 1
		bias_term: false
	}
}

layer {
  bottom: "res_4_block0_conv_proj_conv2d"
  top: "res_4_block0_conv_proj_batchnorm"
  name: "res_4_block0_conv_proj_batchnorm"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 0.001
  }
}
layer {
  bottom: "res_4_block0_conv_proj_batchnorm"
  top: "res_4_block0_conv_proj_batchnorm"
  name: "res_4_block0_conv_proj_batchnorm_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
  name: "_plus4"
  type: "Eltwise"
  bottom: "res_4_block0_conv_proj_batchnorm"
  bottom: "dconv_34_conv_proj_batchnorm"
  top: "_plus4"
  eltwise_param { operation: SUM }
}

layer {
	bottom: "_plus4"
	top: "res_4_block1_conv_sep_conv2d"
	name: "res_4_block1_conv_sep_conv2d"
	type: "Convolution"
	convolution_param {
		num_output: 256
		kernel_size: 1
		pad: 0
		stride: 1
		bias_term: false
	}
}

layer {
  bottom: "res_4_block1_conv_sep_conv2d"
  top: "res_4_block1_conv_sep_batchnorm"
  name: "res_4_block1_conv_sep_batchnorm"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 0.001
  }
}
layer {
  bottom: "res_4_block1_conv_sep_batchnorm"
  top: "res_4_block1_conv_sep_batchnorm"
  name: "res_4_block1_conv_sep_batchnorm_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
  bottom: "res_4_block1_conv_sep_batchnorm"
  top: "res_4_block1_conv_sep_relu"
  name: "res_4_block1_conv_sep_relu"
  type: "ReLU"
}

layer {
	bottom: "res_4_block1_conv_sep_relu"
	top: "res_4_block1_conv_dw_conv2d"
	name: "res_4_block1_conv_dw_conv2d"
	type: "Convolution"
	convolution_param {
		num_output: 256
		kernel_size: 3
		pad: 1
		group: 256
            engine:CAFFE
		stride: 1
		bias_term: false
	}
}

layer {
  bottom: "res_4_block1_conv_dw_conv2d"
  top: "res_4_block1_conv_dw_batchnorm"
  name: "res_4_block1_conv_dw_batchnorm"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 0.001
  }
}
layer {
  bottom: "res_4_block1_conv_dw_batchnorm"
  top: "res_4_block1_conv_dw_batchnorm"
  name: "res_4_block1_conv_dw_batchnorm_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
  bottom: "res_4_block1_conv_dw_batchnorm"
  top: "res_4_block1_conv_dw_relu"
  name: "res_4_block1_conv_dw_relu"
  type: "ReLU"
}

layer {
	bottom: "res_4_block1_conv_dw_relu"
	top: "res_4_block1_conv_proj_conv2d"
	name: "res_4_block1_conv_proj_conv2d"
	type: "Convolution"
	convolution_param {
		num_output: 128
		kernel_size: 1
		pad: 0
		stride: 1
		bias_term: false
	}
}

layer {
  bottom: "res_4_block1_conv_proj_conv2d"
  top: "res_4_block1_conv_proj_batchnorm"
  name: "res_4_block1_conv_proj_batchnorm"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 0.001
  }
}
layer {
  bottom: "res_4_block1_conv_proj_batchnorm"
  top: "res_4_block1_conv_proj_batchnorm"
  name: "res_4_block1_conv_proj_batchnorm_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
  name: "_plus5"
  type: "Eltwise"
  bottom: "res_4_block1_conv_proj_batchnorm"
  bottom: "_plus4"
  top: "_plus5"
  eltwise_param { operation: SUM }
}

layer {
	bottom: "_plus5"
	top: "res_4_block2_conv_sep_conv2d"
	name: "res_4_block2_conv_sep_conv2d"
	type: "Convolution"
	convolution_param {
		num_output: 256
		kernel_size: 1
		pad: 0
		stride: 1
		bias_term: false
	}
}

layer {
  bottom: "res_4_block2_conv_sep_conv2d"
  top: "res_4_block2_conv_sep_batchnorm"
  name: "res_4_block2_conv_sep_batchnorm"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 0.001
  }
}
layer {
  bottom: "res_4_block2_conv_sep_batchnorm"
  top: "res_4_block2_conv_sep_batchnorm"
  name: "res_4_block2_conv_sep_batchnorm_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
  bottom: "res_4_block2_conv_sep_batchnorm"
  top: "res_4_block2_conv_sep_relu"
  name: "res_4_block2_conv_sep_relu"
  type: "ReLU"
}

layer {
	bottom: "res_4_block2_conv_sep_relu"
	top: "res_4_block2_conv_dw_conv2d"
	name: "res_4_block2_conv_dw_conv2d"
	type: "Convolution"
	convolution_param {
		num_output: 256
		kernel_size: 3
		pad: 1
		group: 256
            engine:CAFFE
		stride: 1
		bias_term: false
	}
}

layer {
  bottom: "res_4_block2_conv_dw_conv2d"
  top: "res_4_block2_conv_dw_batchnorm"
  name: "res_4_block2_conv_dw_batchnorm"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 0.001
  }
}
layer {
  bottom: "res_4_block2_conv_dw_batchnorm"
  top: "res_4_block2_conv_dw_batchnorm"
  name: "res_4_block2_conv_dw_batchnorm_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
  bottom: "res_4_block2_conv_dw_batchnorm"
  top: "res_4_block2_conv_dw_relu"
  name: "res_4_block2_conv_dw_relu"
  type: "ReLU"
}

layer {
	bottom: "res_4_block2_conv_dw_relu"
	top: "res_4_block2_conv_proj_conv2d"
	name: "res_4_block2_conv_proj_conv2d"
	type: "Convolution"
	convolution_param {
		num_output: 128
		kernel_size: 1
		pad: 0
		stride: 1
		bias_term: false
	}
}

layer {
  bottom: "res_4_block2_conv_proj_conv2d"
  top: "res_4_block2_conv_proj_batchnorm"
  name: "res_4_block2_conv_proj_batchnorm"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 0.001
  }
}
layer {
  bottom: "res_4_block2_conv_proj_batchnorm"
  top: "res_4_block2_conv_proj_batchnorm"
  name: "res_4_block2_conv_proj_batchnorm_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
  name: "_plus6"
  type: "Eltwise"
  bottom: "res_4_block2_conv_proj_batchnorm"
  bottom: "_plus5"
  top: "_plus6"
  eltwise_param { operation: SUM }
}

layer {
	bottom: "_plus6"
	top: "res_4_block3_conv_sep_conv2d"
	name: "res_4_block3_conv_sep_conv2d"
	type: "Convolution"
	convolution_param {
		num_output: 256
		kernel_size: 1
		pad: 0
		stride: 1
		bias_term: false
	}
}

layer {
  bottom: "res_4_block3_conv_sep_conv2d"
  top: "res_4_block3_conv_sep_batchnorm"
  name: "res_4_block3_conv_sep_batchnorm"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 0.001
  }
}
layer {
  bottom: "res_4_block3_conv_sep_batchnorm"
  top: "res_4_block3_conv_sep_batchnorm"
  name: "res_4_block3_conv_sep_batchnorm_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
  bottom: "res_4_block3_conv_sep_batchnorm"
  top: "res_4_block3_conv_sep_relu"
  name: "res_4_block3_conv_sep_relu"
  type: "ReLU"
}

layer {
	bottom: "res_4_block3_conv_sep_relu"
	top: "res_4_block3_conv_dw_conv2d"
	name: "res_4_block3_conv_dw_conv2d"
	type: "Convolution"
	convolution_param {
		num_output: 256
		kernel_size: 3
		pad: 1
		group: 256
            engine:CAFFE
		stride: 1
		bias_term: false
	}
}

layer {
  bottom: "res_4_block3_conv_dw_conv2d"
  top: "res_4_block3_conv_dw_batchnorm"
  name: "res_4_block3_conv_dw_batchnorm"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 0.001
  }
}
layer {
  bottom: "res_4_block3_conv_dw_batchnorm"
  top: "res_4_block3_conv_dw_batchnorm"
  name: "res_4_block3_conv_dw_batchnorm_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
  bottom: "res_4_block3_conv_dw_batchnorm"
  top: "res_4_block3_conv_dw_relu"
  name: "res_4_block3_conv_dw_relu"
  type: "ReLU"
}

layer {
	bottom: "res_4_block3_conv_dw_relu"
	top: "res_4_block3_conv_proj_conv2d"
	name: "res_4_block3_conv_proj_conv2d"
	type: "Convolution"
	convolution_param {
		num_output: 128
		kernel_size: 1
		pad: 0
		stride: 1
		bias_term: false
	}
}

layer {
  bottom: "res_4_block3_conv_proj_conv2d"
  top: "res_4_block3_conv_proj_batchnorm"
  name: "res_4_block3_conv_proj_batchnorm"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 0.001
  }
}
layer {
  bottom: "res_4_block3_conv_proj_batchnorm"
  top: "res_4_block3_conv_proj_batchnorm"
  name: "res_4_block3_conv_proj_batchnorm_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
  name: "_plus7"
  type: "Eltwise"
  bottom: "res_4_block3_conv_proj_batchnorm"
  bottom: "_plus6"
  top: "_plus7"
  eltwise_param { operation: SUM }
}

layer {
	bottom: "_plus7"
	top: "res_4_block4_conv_sep_conv2d"
	name: "res_4_block4_conv_sep_conv2d"
	type: "Convolution"
	convolution_param {
		num_output: 256
		kernel_size: 1
		pad: 0
		stride: 1
		bias_term: false
	}
}

layer {
  bottom: "res_4_block4_conv_sep_conv2d"
  top: "res_4_block4_conv_sep_batchnorm"
  name: "res_4_block4_conv_sep_batchnorm"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 0.001
  }
}
layer {
  bottom: "res_4_block4_conv_sep_batchnorm"
  top: "res_4_block4_conv_sep_batchnorm"
  name: "res_4_block4_conv_sep_batchnorm_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
  bottom: "res_4_block4_conv_sep_batchnorm"
  top: "res_4_block4_conv_sep_relu"
  name: "res_4_block4_conv_sep_relu"
  type: "ReLU"
}

layer {
	bottom: "res_4_block4_conv_sep_relu"
	top: "res_4_block4_conv_dw_conv2d"
	name: "res_4_block4_conv_dw_conv2d"
	type: "Convolution"
	convolution_param {
		num_output: 256
		kernel_size: 3
		pad: 1
		group: 256
            engine:CAFFE
		stride: 1
		bias_term: false
	}
}

layer {
  bottom: "res_4_block4_conv_dw_conv2d"
  top: "res_4_block4_conv_dw_batchnorm"
  name: "res_4_block4_conv_dw_batchnorm"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 0.001
  }
}
layer {
  bottom: "res_4_block4_conv_dw_batchnorm"
  top: "res_4_block4_conv_dw_batchnorm"
  name: "res_4_block4_conv_dw_batchnorm_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
  bottom: "res_4_block4_conv_dw_batchnorm"
  top: "res_4_block4_conv_dw_relu"
  name: "res_4_block4_conv_dw_relu"
  type: "ReLU"
}

layer {
	bottom: "res_4_block4_conv_dw_relu"
	top: "res_4_block4_conv_proj_conv2d"
	name: "res_4_block4_conv_proj_conv2d"
	type: "Convolution"
	convolution_param {
		num_output: 128
		kernel_size: 1
		pad: 0
		stride: 1
		bias_term: false
	}
}

layer {
  bottom: "res_4_block4_conv_proj_conv2d"
  top: "res_4_block4_conv_proj_batchnorm"
  name: "res_4_block4_conv_proj_batchnorm"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 0.001
  }
}
layer {
  bottom: "res_4_block4_conv_proj_batchnorm"
  top: "res_4_block4_conv_proj_batchnorm"
  name: "res_4_block4_conv_proj_batchnorm_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
  name: "_plus8"
  type: "Eltwise"
  bottom: "res_4_block4_conv_proj_batchnorm"
  bottom: "_plus7"
  top: "_plus8"
  eltwise_param { operation: SUM }
}

layer {
	bottom: "_plus8"
	top: "res_4_block5_conv_sep_conv2d"
	name: "res_4_block5_conv_sep_conv2d"
	type: "Convolution"
	convolution_param {
		num_output: 256
		kernel_size: 1
		pad: 0
		stride: 1
		bias_term: false
	}
}

layer {
  bottom: "res_4_block5_conv_sep_conv2d"
  top: "res_4_block5_conv_sep_batchnorm"
  name: "res_4_block5_conv_sep_batchnorm"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 0.001
  }
}
layer {
  bottom: "res_4_block5_conv_sep_batchnorm"
  top: "res_4_block5_conv_sep_batchnorm"
  name: "res_4_block5_conv_sep_batchnorm_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
  bottom: "res_4_block5_conv_sep_batchnorm"
  top: "res_4_block5_conv_sep_relu"
  name: "res_4_block5_conv_sep_relu"
  type: "ReLU"
}

layer {
	bottom: "res_4_block5_conv_sep_relu"
	top: "res_4_block5_conv_dw_conv2d"
	name: "res_4_block5_conv_dw_conv2d"
	type: "Convolution"
	convolution_param {
		num_output: 256
		kernel_size: 3
		pad: 1
		group: 256
            engine:CAFFE
		stride: 1
		bias_term: false
	}
}

layer {
  bottom: "res_4_block5_conv_dw_conv2d"
  top: "res_4_block5_conv_dw_batchnorm"
  name: "res_4_block5_conv_dw_batchnorm"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 0.001
  }
}
layer {
  bottom: "res_4_block5_conv_dw_batchnorm"
  top: "res_4_block5_conv_dw_batchnorm"
  name: "res_4_block5_conv_dw_batchnorm_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
  bottom: "res_4_block5_conv_dw_batchnorm"
  top: "res_4_block5_conv_dw_relu"
  name: "res_4_block5_conv_dw_relu"
  type: "ReLU"
}

layer {
	bottom: "res_4_block5_conv_dw_relu"
	top: "res_4_block5_conv_proj_conv2d"
	name: "res_4_block5_conv_proj_conv2d"
	type: "Convolution"
	convolution_param {
		num_output: 128
		kernel_size: 1
		pad: 0
		stride: 1
		bias_term: false
	}
}

layer {
  bottom: "res_4_block5_conv_proj_conv2d"
  top: "res_4_block5_conv_proj_batchnorm"
  name: "res_4_block5_conv_proj_batchnorm"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 0.001
  }
}
layer {
  bottom: "res_4_block5_conv_proj_batchnorm"
  top: "res_4_block5_conv_proj_batchnorm"
  name: "res_4_block5_conv_proj_batchnorm_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
  name: "_plus9"
  type: "Eltwise"
  bottom: "res_4_block5_conv_proj_batchnorm"
  bottom: "_plus8"
  top: "_plus9"
  eltwise_param { operation: SUM }
}

layer {
	bottom: "_plus9"
	top: "dconv_45_conv_sep_conv2d"
	name: "dconv_45_conv_sep_conv2d"
	type: "Convolution"
	convolution_param {
		num_output: 512
		kernel_size: 1
		pad: 0
		stride: 1
		bias_term: false
	}
}

layer {
  bottom: "dconv_45_conv_sep_conv2d"
  top: "dconv_45_conv_sep_batchnorm"
  name: "dconv_45_conv_sep_batchnorm"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 0.001
  }
}
layer {
  bottom: "dconv_45_conv_sep_batchnorm"
  top: "dconv_45_conv_sep_batchnorm"
  name: "dconv_45_conv_sep_batchnorm_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
  bottom: "dconv_45_conv_sep_batchnorm"
  top: "dconv_45_conv_sep_relu"
  name: "dconv_45_conv_sep_relu"
  type: "ReLU"
}

layer {
	bottom: "dconv_45_conv_sep_relu"
	top: "dconv_45_conv_dw_conv2d"
	name: "dconv_45_conv_dw_conv2d"
	type: "Convolution"
	convolution_param {
		num_output: 512
		kernel_size: 3
		pad: 1
		group: 512
            engine:CAFFE
		stride: 2
		bias_term: false
	}
}

layer {
  bottom: "dconv_45_conv_dw_conv2d"
  top: "dconv_45_conv_dw_batchnorm"
  name: "dconv_45_conv_dw_batchnorm"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 0.001
  }
}
layer {
  bottom: "dconv_45_conv_dw_batchnorm"
  top: "dconv_45_conv_dw_batchnorm"
  name: "dconv_45_conv_dw_batchnorm_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
  bottom: "dconv_45_conv_dw_batchnorm"
  top: "dconv_45_conv_dw_relu"
  name: "dconv_45_conv_dw_relu"
  type: "ReLU"
}

layer {
	bottom: "dconv_45_conv_dw_relu"
	top: "dconv_45_conv_proj_conv2d"
	name: "dconv_45_conv_proj_conv2d"
	type: "Convolution"
	convolution_param {
		num_output: 128
		kernel_size: 1
		pad: 0
		stride: 1
		bias_term: false
	}
}

layer {
  bottom: "dconv_45_conv_proj_conv2d"
  top: "dconv_45_conv_proj_batchnorm"
  name: "dconv_45_conv_proj_batchnorm"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 0.001
  }
}
layer {
  bottom: "dconv_45_conv_proj_batchnorm"
  top: "dconv_45_conv_proj_batchnorm"
  name: "dconv_45_conv_proj_batchnorm_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
	bottom: "dconv_45_conv_proj_batchnorm"
	top: "res_5_block0_conv_sep_conv2d"
	name: "res_5_block0_conv_sep_conv2d"
	type: "Convolution"
	convolution_param {
		num_output: 256
		kernel_size: 1
		pad: 0
		stride: 1
		bias_term: false
	}
}

layer {
  bottom: "res_5_block0_conv_sep_conv2d"
  top: "res_5_block0_conv_sep_batchnorm"
  name: "res_5_block0_conv_sep_batchnorm"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 0.001
  }
}
layer {
  bottom: "res_5_block0_conv_sep_batchnorm"
  top: "res_5_block0_conv_sep_batchnorm"
  name: "res_5_block0_conv_sep_batchnorm_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
  bottom: "res_5_block0_conv_sep_batchnorm"
  top: "res_5_block0_conv_sep_relu"
  name: "res_5_block0_conv_sep_relu"
  type: "ReLU"
}

layer {
	bottom: "res_5_block0_conv_sep_relu"
	top: "res_5_block0_conv_dw_conv2d"
	name: "res_5_block0_conv_dw_conv2d"
	type: "Convolution"
	convolution_param {
		num_output: 256
		kernel_size: 3
		pad: 1
		group: 256
            engine:CAFFE
		stride: 1
		bias_term: false
	}
}

layer {
  bottom: "res_5_block0_conv_dw_conv2d"
  top: "res_5_block0_conv_dw_batchnorm"
  name: "res_5_block0_conv_dw_batchnorm"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 0.001
  }
}
layer {
  bottom: "res_5_block0_conv_dw_batchnorm"
  top: "res_5_block0_conv_dw_batchnorm"
  name: "res_5_block0_conv_dw_batchnorm_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
  bottom: "res_5_block0_conv_dw_batchnorm"
  top: "res_5_block0_conv_dw_relu"
  name: "res_5_block0_conv_dw_relu"
  type: "ReLU"
}

layer {
	bottom: "res_5_block0_conv_dw_relu"
	top: "res_5_block0_conv_proj_conv2d"
	name: "res_5_block0_conv_proj_conv2d"
	type: "Convolution"
	convolution_param {
		num_output: 128
		kernel_size: 1
		pad: 0
		stride: 1
		bias_term: false
	}
}

layer {
  bottom: "res_5_block0_conv_proj_conv2d"
  top: "res_5_block0_conv_proj_batchnorm"
  name: "res_5_block0_conv_proj_batchnorm"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 0.001
  }
}
layer {
  bottom: "res_5_block0_conv_proj_batchnorm"
  top: "res_5_block0_conv_proj_batchnorm"
  name: "res_5_block0_conv_proj_batchnorm_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
  name: "_plus10"
  type: "Eltwise"
  bottom: "res_5_block0_conv_proj_batchnorm"
  bottom: "dconv_45_conv_proj_batchnorm"
  top: "_plus10"
  eltwise_param { operation: SUM }
}

layer {
	bottom: "_plus10"
	top: "res_5_block1_conv_sep_conv2d"
	name: "res_5_block1_conv_sep_conv2d"
	type: "Convolution"
	convolution_param {
		num_output: 256
		kernel_size: 1
		pad: 0
		stride: 1
		bias_term: false
	}
}

layer {
  bottom: "res_5_block1_conv_sep_conv2d"
  top: "res_5_block1_conv_sep_batchnorm"
  name: "res_5_block1_conv_sep_batchnorm"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 0.001
  }
}
layer {
  bottom: "res_5_block1_conv_sep_batchnorm"
  top: "res_5_block1_conv_sep_batchnorm"
  name: "res_5_block1_conv_sep_batchnorm_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
  bottom: "res_5_block1_conv_sep_batchnorm"
  top: "res_5_block1_conv_sep_relu"
  name: "res_5_block1_conv_sep_relu"
  type: "ReLU"
}

layer {
	bottom: "res_5_block1_conv_sep_relu"
	top: "res_5_block1_conv_dw_conv2d"
	name: "res_5_block1_conv_dw_conv2d"
	type: "Convolution"
	convolution_param {
		num_output: 256
		kernel_size: 3
		pad: 1
		group: 256
            engine:CAFFE
		stride: 1
		bias_term: false
	}
}

layer {
  bottom: "res_5_block1_conv_dw_conv2d"
  top: "res_5_block1_conv_dw_batchnorm"
  name: "res_5_block1_conv_dw_batchnorm"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 0.001
  }
}
layer {
  bottom: "res_5_block1_conv_dw_batchnorm"
  top: "res_5_block1_conv_dw_batchnorm"
  name: "res_5_block1_conv_dw_batchnorm_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
  bottom: "res_5_block1_conv_dw_batchnorm"
  top: "res_5_block1_conv_dw_relu"
  name: "res_5_block1_conv_dw_relu"
  type: "ReLU"
}

layer {
	bottom: "res_5_block1_conv_dw_relu"
	top: "res_5_block1_conv_proj_conv2d"
	name: "res_5_block1_conv_proj_conv2d"
	type: "Convolution"
	convolution_param {
		num_output: 128
		kernel_size: 1
		pad: 0
		stride: 1
		bias_term: false
	}
}

layer {
  bottom: "res_5_block1_conv_proj_conv2d"
  top: "res_5_block1_conv_proj_batchnorm"
  name: "res_5_block1_conv_proj_batchnorm"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 0.001
  }
}
layer {
  bottom: "res_5_block1_conv_proj_batchnorm"
  top: "res_5_block1_conv_proj_batchnorm"
  name: "res_5_block1_conv_proj_batchnorm_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
  name: "_plus11"
  type: "Eltwise"
  bottom: "res_5_block1_conv_proj_batchnorm"
  bottom: "_plus10"
  top: "_plus11"
  eltwise_param { operation: SUM }
}

layer {
	bottom: "_plus11"
	top: "conv_6sep_conv2d"
	name: "conv_6sep_conv2d"
	type: "Convolution"
	convolution_param {
		num_output: 512
		kernel_size: 1
		pad: 0
		stride: 1
		bias_term: false
	}
}

layer {
  bottom: "conv_6sep_conv2d"
  top: "conv_6sep_batchnorm"
  name: "conv_6sep_batchnorm"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 0.001
  }
}
layer {
  bottom: "conv_6sep_batchnorm"
  top: "conv_6sep_batchnorm"
  name: "conv_6sep_batchnorm_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
  bottom: "conv_6sep_batchnorm"
  top: "conv_6sep_relu"
  name: "conv_6sep_relu"
  type: "ReLU"
}

layer {
  bottom: "conv_6sep_relu"
  top: "bn6f"
  name: "bn6f"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 2e-05
  }
}
layer {
  bottom: "bn6f"
  top: "bn6f"
  name: "bn6f_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
  bottom: "bn6f"
  top: "pooling0"
  name: "pooling0"
  type: "Pooling"
  pooling_param {
    pool: AVE
    kernel_size: 7
  }
}

layer {
  bottom: "pooling0"
  top: "bn6w"
  name: "bn6w"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 2e-05
  }
}
layer {
  bottom: "bn6w"
  top: "bn6w"
  name: "bn6w_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

layer {
  bottom: "bn6w"
  top: "pre_fc1"
  name: "pre_fc1"
  type: "InnerProduct"
  inner_product_param {
    num_output: 128
  }
}

layer {
  bottom: "pre_fc1"
  top: "fc1"
  name: "fc1"
  type: "BatchNorm"
  batch_norm_param {
    use_global_stats: true
    moving_average_fraction: 0.9
    eps: 2e-05
  }
}
layer {
  bottom: "fc1"
  top: "fc1"
  name: "fc1_scale"
  type: "Scale"
  scale_param { bias_term: true }
}

refer to this, https://devtalk.nvidia.com/default/topic/1064429/deepstream-sdk/error-when-use-facedetection-model-with-deepstream_test1_app/, similar issue.

Hi amycao,
Thanks you very much for your help.

1

Hi,

You can find a sample in /opt/nvidia/deepstream/deepstream-4.0/sources/objectDetector_SSD/.

1. You will need to implement a custom parser defined as this :

typedef bool (* NvDsInferParseCustomFunc) (
        std::vector<NvDsInferLayerInfo> const &outputLayersInfo,
        NvDsInferNetworkInfo  const &networkInfo,
        NvDsInferParseDetectionParams const &detectionParams,
        std::vector<NvDsInferObjectDetectionInfo> &objectList);

Sample: /opt/nvidia/deepstream/deepstream-4.0/sources/objectDetector_SSD/nvdsinfer_custom_impl_ssd/nvdsparsebbox_ssd.cpp

2. Compile your parser into a library.
You can update this Makefile into your function and file name.
/opt/nvidia/deepstream/deepstream-4.0/sources/objectDetector_SSD/nvdsinfer_custom_impl_ssd/Makefile

3. Update the function name and library path in the configure file.
Ex. config_infer_primary_ssd.txt

[property]
...
bbox-func-name=NvDsInferParseCustomSSD     # function name
custom-lib-path=nvdsinfer_custom_impl_ssd/libnvdsinfer_custom_impl_ssd.so  #library path

Then Deepstream will launch the NvDsInferParseCustomSSD function, which should include in the nvdsinfer_custom_impl_ssd/libnvdsinfer_custom_impl_ssd.so as a custom parser.

Thanks.