deepstream 6.0 부터 NHWC 네트워크 입력을 지원한다고 한다.
그런데 이 NHWC가 먼지 몰라서 헤매는 중...
그러니까.. 이전에는 NHWC는 지원하지 않았으니 NCHW만 지원했던건가?
Support for NHWC network input DS 6.0 |
nvinfer 모듈에서 NCHW가 언급되는 항목은 아래와 같은데
입력 레이어, 출력 레이어의 순서 그리고 uff 관련 입력 차원/순서에 대한 내용인데..
UFF 안쓰면 network-input-order와 segmentation-output-order만 보면 될 것 같긴하다.
network-input-order | Order of the network input layer (ignored if input-tensor-meta enabled) | Integer 0:NCHW 1:NHWC | network-input-order=1 | All Both |
segmentation-output-order | Segmentation network output layer order | Integer 0: NCHW 1: NHWC | segmentation-output-order=1 | Segmentation Both |
uff-input-dims | DEPRECATED. Use infer-dims and uff-input-order instead. Dimensions of the UFF model |
channel; height; width; input-order All integers, ≥0 | input-dims=3;224;224;0 Possible values for input-order are: 0: NCHW 1: NHWC |
All Both |
uff-input-order | UFF input layer order | Integer 0: NCHW 1: NHWC 2: NC | uff-input-order=1 | All Both |
[링크 : https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_plugin_gst-nvinfer.html]
conv 연산시 nhwc가 nchw에 비해서 빠르다고 하는데 데이터 순서에 따른 인접성 때문에 그런가?
[링크 : https://moon-walker.medium.com/train-faster-텐서플로우-성능-최적화-기법-d67d3faee959]
약어는 아래와 같다고.
N: number of images in the batch H: height of the image W: width of the image C: number of channels of the image (ex: 3 for RGB, 1 for grayscale...) |
[링크 : https://stackoverflow.com/questions/37689423/convert-between-nhwc-and-nchw-in-tensorflow]
[링크 : https://code-examples.net/ko/q/23f184f]
일단.. deepstream 에서 받아들이는 텐서는 3x320x320 인데
INFO: [Implicit Engine Info]: layers num: 4 0 INPUT kFLOAT image_tensor 3x320x320 1 OUTPUT kHALF detected_boxes 256x4 2 OUTPUT kINT32 detected_classes 256 3 OUTPUT kHALF detected_scores 256 |
NCHW를 NHWC로 바꾸니까
1x3x320x320 으로 들어올 것이
1x320x320x3 으로 들어오는지 범위를 벗어났다고 경고를 띄운다.
WARNING: Backend context bufferIdx(0) request dims:1x320x320x3 is out of range, [min: 1x3x320x320, max: 1x3x320x320] ERROR: [TRT]: 4: [network.cpp::validate::2959] Error Code 4: Internal Error (image_tensor: for dimension number 1 in profile 0 does not match network definition (got min=320, opt=320, max=320), expected min=opt=max=3).) ERROR: Build engine failed from config file ERROR: failed to build trt engine. 0:00:05.708555452 30995 0x2a01fa70 ERROR nvinfer gstnvinfer.cpp:632:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Error in NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:1934> [UID = 1]: build engine file failed 0:00:05.713238769 30995 0x2a01fa70 ERROR nvinfer gstnvinfer.cpp:632:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Error in NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:2020> [UID = 1]: build backend context failed 0:00:05.713377574 30995 0x2a01fa70 ERROR nvinfer gstnvinfer.cpp:632:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Error in NvDsInferContextImpl::initialize() <nvdsinfer_context_impl.cpp:1257> [UID = 1]: generate backend failed, check config file settings ** ERROR: <main:707>: Failed to set pipeline to PAUSED Quitting ERROR from primary_gie: Failed to create NvDsInferContext instance Debug info: /dvs/git/dirty/git-master_linux/deepstream/sdk/src/gst-plugins/gst-nvinfer/gstnvinfer.cpp(841): gst_nvinfer_start (): /GstPipeline:pipeline/GstBin:primary_gie_bin/GstNvInfer:primary_gie: Config file path: /opt/nvidia/deepstream/deepstream-6.0/sources/objectDetector_SSD/config_infer_primary_ssd.txt, NvDsInfer Error: NVDSINFER_CONFIG_FAILED |
'embeded > jetson' 카테고리의 다른 글
젯슨 레이서 조립 2 (0) | 2023.01.21 |
---|---|
젯슨 레이서 조립 1 (0) | 2023.01.20 |
FLIR ETS320 / v4l (0) | 2022.04.21 |
deepstream 구조, gstreamer module 설명 (2) | 2022.04.19 |
deepstream nvinfer (0) | 2022.04.18 |