Programming/golang2022. 3. 31. 23:52

node.js나 python 같은 인터프리트 언어가 대세라 그런가..

컴파일 언어를 인터프리트 언어 처럼 쓰게 해주는 환경이라니..

REPL(read-eval-print loop)

[링크 : https://github.com/x-motemen/gore]

[링크 : https://gorepl.com/]

[링크 : https://tkim.info/ko/devnote/d054-gore쓰다가-답답해서-tour-of-go-설치해서-쓴-썰/]

 

delve는 디버거 패키지.. 아니 툴이라고 해야하나?

[링크 : https://www.joinc.co.kr/w/man/12/golang/delve]

'Programming > golang' 카테고리의 다른 글

golang 다른 파일 함수 불러오기  (0) 2022.04.04
liteide  (0) 2022.04.04
go build 옵션  (0) 2022.03.31
go lang static http server  (0) 2022.03.10
go hello world build static / shared  (0) 2022.02.17
Posted by 구차니
Programming/golang2022. 3. 31. 19:05

gcc와 유사한 옵션들이군..

 

-o 옵션을 통해 실행파일 이름을 지정할 수 있는데, 지정하지 않을 경우 소스코드의 이름을 출력이름으로 지정한다.

go build [-o output] [build flags] [packages]

[링크 : https://pkg.go.dev/cmd/go]

 

 

$ go build -linkshared filename.go

옵션을 통해 빌드할때

open /usr/lib/go-1.17/pkg/linux_amd64_dynlink/archive/zip.shlibname: permission denied

권한이 부족해서 거부되었다는 에러가 발생하는데 대개는 sudo를 주고 하지만

왜 발생하나 궁금해서 찾아보니

dynlink에 파일들이 linkshared 옵션으로 빌드할때 날짜가 변경되는 것으로 보인다.

*.a 나 libstd.so 들 역시 변경되는걸 봐서는 linkshared로 빌드할때 해당 so도 같이 빌드 하는 듯.

[링크 : https://superuser.com/questions/739738/how-to-use-go-get-as-non-root]

 

dynlink 에서 GOROOT라는 변수가 보이길래 보는데 선언된건 없고..

$ cd $GOROOT/pkg/linux_amd64_dynlink
$ ls libstd.so
libstd.so

[링크 : https://www.codestudyblog.com/cs2112goa/1212131010.html]

 

도움말 보다보니 env라는 명령어 발견

$ go --help
Go is a tool for managing Go source code.

Usage:

        go <command> [arguments]

The commands are:

        bug         start a bug report
        build       compile packages and dependencies
        clean       remove object files and cached files
        doc         show documentation for package or symbol
        env         print Go environment information
        fix         update packages to use new APIs
        fmt         gofmt (reformat) package sources
        generate    generate Go files by processing source
        get         add dependencies to current module and install them
        install     compile and install packages and dependencies
        list        list packages or modules
        mod         module maintenance
        run         compile and run Go program
        test        test packages
        tool        run specified go tool
        version     print Go version
        vet         report likely mistakes in packages

Use "go help <command>" for more information about a command.

Additional help topics:

        buildconstraint build constraints
        buildmode       build modes
        c               calling between Go and C
        cache           build and test caching
        environment     environment variables
        filetype        file types
        go.mod          the go.mod file
        gopath          GOPATH environment variable
        gopath-get      legacy GOPATH go get
        goproxy         module proxy protocol
        importpath      import path syntax
        modules         modules, module versions, and more
        module-get      module-aware go get
        module-auth     module authentication using go.sum
        packages        package lists and patterns
        private         configuration for downloading non-public code
        testflag        testing flags
        testfunc        testing functions
        vcs             controlling version control with GOVCS

Use "go help <topic>" for more information about that topic.

 

$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/minimonk/.cache/go-build"
GOENV="/home/minimonk/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/minimonk/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/minimonk/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go-1.17"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go-1.17/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.17.8"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build1772520358=/tmp/go-build -gno-record-gcc-switches"

 

저 놈의 GOTOOLDIR을 바꾸어 주면 되려나?

 

GOOS와 GOARCH를 이용해서 크로스컴파일 가능하다고 한다.

$ env GOOS=windows GOARCH=amd64 go build source.go

[링크 : https://www.digitalocean.com/community/tutorials/how-to-build-go-executables-for-multiple-platforms-on-ubuntu-16-04]

 

이게 되네..

$ GOARCH=arm go build hello.go
$ file hello
hello: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, not stripped

$ GOARCH=arm64 go build hello.go
$ file hello
hello: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, not stripped

 

'Programming > golang' 카테고리의 다른 글

liteide  (0) 2022.04.04
golang gore(repl), delve  (0) 2022.03.31
go lang static http server  (0) 2022.03.10
go hello world build static / shared  (0) 2022.02.17
go lang rest  (0) 2022.02.11
Posted by 구차니
파일방2022. 3. 31. 17:15

gstreamer 에러 로그 보는데 색상이 있으면 좋겠다 싶어서

gst-launch .. > log 2>&1

으로 로그 저장하고 aha로 변환

 

[링크 : https://github.com/theZiz/aha]

  [링크 : https://blog.asamaru.net/2015/10/26/ansi-to-html/]

'파일방' 카테고리의 다른 글

codesys  (0) 2022.05.18
debian noroot 와 userland  (0) 2022.05.02
mscgen  (0) 2022.03.17
android userland ubuntu  (0) 2022.03.03
bingwall (for ubuntu)  (0) 2022.01.19
Posted by 구차니
embeded/jetson2022. 3. 30. 21:49

이 한줄이 참.. 많은 문제를 낳는구만.. -_-

$ gst-launch-1.0 nvinferserver
ERROR: pipeline could not be constructed: no element "nvinferserver".

 

왜 안되나 했는데 native하게 까는건 없는지 멀 하려고 하면 다 막히고, 걍 docker로 ㄱㄱ -_-

Can Gst-nvinfereserver (DeepSream Triton plugin) run on Nano platform?
Yes. But due to Nano’s memory limitation, performance of certain models is slow and even run into OOM (out of memory) issues, specifically on heavy Tensorflow models. There is an option to run CPU instance for certain models on Nano. For more details, see samples/configs/deepstream-app-triton/README

[링크 : https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_FAQ.html]

[링크 : https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_plugin_gst-nvinferserver.html]

 

어느쪽 말이 맞는거냐 -_-

[링크 : https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_plugin_gst-nvinferserver.html]

 

일단 실행은 이렇게 하면 되려나.. ds l4t 인지 ds triton으로 해야할지 모르겠네

$ sudo docker run --rm -it nvcr.io/nvidia/deepstream-l4t:6.0-samples /bin/bash

[링크 : https://medium.com/@Smartcow_ai/building-arm64-based-docker-containers-for-nvidia-jetson-devices-on-an-x86-based-host-d72cfa535786]

 

하나가 되면 하나가 안되고 아놔 ㅋㅋㅋ

$ sudo docker image ls
REPOSITORY                      TAG            IMAGE ID       CREATED       SIZE
nvcr.io/nvidia/deepstream       6.0.1-triton   ac5f4c456b5b   5 weeks ago   17.5GB
nvcr.io/nvidia/deepstream-l4t   6.0.1-triton   d3984db2b6b1   6 weeks ago   3.98GB

$ sudo docker run --rm -it d3984db2b6b1 /bin/bash
root@d30ca855a6ce:/opt/nvidia/deepstream/deepstream-6.0# gst-inspect-1.0 nvinferserver

(gst-plugin-scanner:12): GStreamer-WARNING **: 01:40:47.344: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_osd.so': libnvbufsurface.so.1.0.0: cannot open shared object file: No such file or directory

(gst-plugin-scanner:12): GStreamer-WARNING **: 01:40:47.378: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_inferaudio.so': libcufft.so.10: cannot open shared object file: No such file or directory

(gst-plugin-scanner:12): GStreamer-WARNING **: 01:40:47.454: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_deepstream_bins.so': libnvdsbufferpool.so.1.0.0: cannot open shared object file: No such file or directory

(gst-plugin-scanner:12): GStreamer-WARNING **: 01:40:47.456: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/deepstream/libgstnvvideoconvert.so': libnvdsbufferpool.so.1.0.0: cannot open shared object file: No such file or directory

(gst-plugin-scanner:12): GStreamer-WARNING **: 01:40:47.477: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_preprocess.so': libnvbufsurface.so.1.0.0: cannot open shared object file: No such file or directory

(gst-plugin-scanner:12): GStreamer-WARNING **: 01:40:47.479: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_infer.so': libnvbufsurface.so.1.0.0: cannot open shared object file: No such file or directory

(gst-plugin-scanner:12): GStreamer-WARNING **: 01:40:47.490: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_multistream.so': libnvbufsurface.so.1.0.0: cannot open shared object file: No such file or directory

(gst-plugin-scanner:12): GStreamer-WARNING **: 01:40:47.499: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_ofvisual.so': libnvdsbufferpool.so.1.0.0: cannot open shared object file: No such file or directory

(gst-plugin-scanner:12): GStreamer-WARNING **: 01:40:47.508: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_dsexample.so': libnvbufsurface.so.1.0.0: cannot open shared object file: No such file or directory

(gst-plugin-scanner:12): GStreamer-WARNING **: 01:40:47.511: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_tracker.so': libnvbufsurface.so.1.0.0: cannot open shared object file: No such file or directory

(gst-plugin-scanner:12): GStreamer-WARNING **: 01:40:47.543: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_segvisual.so': libnvdsbufferpool.so.1.0.0: cannot open shared object file: No such file or directory

(gst-plugin-scanner:12): GStreamer-WARNING **: 01:40:47.619: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_inferserver.so': libnvbufsurface.so.1.0.0: cannot open shared object file: No such file or directory

(gst-plugin-scanner:12): GStreamer-WARNING **: 01:40:47.638: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/deepstream/libcustom2d_preprocess.so': libnvbufsurftransform.so.1.0.0: cannot open shared object file: No such file or directory

(gst-plugin-scanner:12): GStreamer-WARNING **: 01:40:47.660: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_udp.so': librivermax.so.0: cannot open shared object file: No such file or directory

(gst-plugin-scanner:12): GStreamer-WARNING **: 01:40:47.664: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_dewarper.so': libnvdsbufferpool.so.1.0.0: cannot open shared object file: No such file or directory

(gst-plugin-scanner:12): GStreamer-WARNING **: 01:40:47.667: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_multistreamtiler.so': libnvbufsurface.so.1.0.0: cannot open shared object file: No such file or directory
No such element or plugin 'nvinferserver'

 

에라이 -_-

$ sudo docker image list
REPOSITORY                      TAG            IMAGE ID       CREATED       SIZE
nvcr.io/nvidia/deepstream       6.0.1-triton   ac5f4c456b5b   5 weeks ago   17.5GB
nvcr.io/nvidia/deepstream-l4t   6.0.1-triton   d3984db2b6b1   6 weeks ago   3.98GB

$ sudo docker run --rm -it ac5f4c456b5b /bin/bash
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
standard_init_linux.go:228: exec user process caused: exec format error

 

Building Jetson Containers on an x86 workstation (using qemu)

[링크 : https://github.com/NVIDIA/nvidia-docker/wiki/NVIDIA-Container-Runtime-on-Jetson]

 

+

[링크 : https://blog.ml6.eu/nvidia-deepstream-quickstart-9147dd49a15d]

 

+

deb로 깔아도 install을 해주어야 하는것인가!!!

$ cd /opt/nvidia/deepstream/deepstream-6.0
$ sudo ./install.sh
$ sudo ldconfig

[링크 : https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_Quickstart.html#jetson-setup]

 

 

$ gst-inspect-1.0 nvinferserver
Factory Details:
  Rank                     primary (256)
  Long-name                NvInferServer plugin
  Klass                    NvInferServer Plugin
  Description              Nvidia DeepStreamSDK TensorRT plugin
  Author                   NVIDIA Corporation. Deepstream for Tesla forum: https://devtalk.nvidia.com/default/board/209

Plugin Details:
  Name                     nvdsgst_inferserver
  Description              NVIDIA DeepStreamSDK TensorRT Inference Server plugin
  Filename                 /usr/lib/aarch64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_inferserver.so
  Version                  6.0.0
  License                  Proprietary
  Source module            nvinferserver
  Binary package           NVIDIA DeepStreamSDK TensorRT Inference Server plugin
  Origin URL               http://nvidia.com/

GObject
 +----GInitiallyUnowned
       +----GstObject
             +----GstElement
                   +----GstBaseTransform
                         +----GstNvInferServer

Pad Templates:
  SRC template: 'src'
    Availability: Always
    Capabilities:
      video/x-raw(memory:NVMM)
                 format: { (string)NV12, (string)RGBA }
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
              framerate: [ 0/1, 2147483647/1 ]

  SINK template: 'sink'
    Availability: Always
    Capabilities:
      video/x-raw(memory:NVMM)
                 format: { (string)NV12, (string)RGBA }
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
              framerate: [ 0/1, 2147483647/1 ]

Element has no clocking capabilities.
Element has no URI handling capabilities.

Pads:
  SINK: 'sink'
    Pad Template: 'sink'
  SRC: 'src'
    Pad Template: 'src'

Element Properties:
  name                : The name of the object
                        flags: readable, writable
                        String. Default: "nvinferserver0"
  parent              : The parent of the object
                        flags: readable, writable
                        Object of type "GstObject"
  qos                 : Handle Quality-of-Service events
                        flags: readable, writable
                        Boolean. Default: false
  unique-id           : Unique ID for the element. Can be used to identify output of the element
                        flags: readable, writable, changeable only in NULL or READY state
                        Unsigned Integer. Range: 0 - 4294967295 Default: 0
  process-mode        : Inferserver processing mode, (0):None, (1)FullFrame, (2)ClipObject
                        flags: readable, writable, changeable only in NULL or READY state
                        Unsigned Integer. Range: 0 - 2 Default: 0
  config-file-path    : Path to the configuration file for this instance of nvinferserver
                        flags: readable, writable, changeable in NULL, READY, PAUSED or PLAYING state
                        String. Default: ""
  batch-size          : Maximum batch size for inference
                        flags: readable, writable, changeable only in NULL or READY state
                        Unsigned Integer. Range: 0 - 1024 Default: 0
  infer-on-gie-id     : Infer on metadata generated by GIE with this unique ID.
                        Set to -1 to infer on all metadata.
                        flags: readable, writable, changeable only in NULL or READY state
                        Integer. Range: -1 - 2147483647 Default: -1
  infer-on-class-ids  : Operate on objects with specified class ids
                        Use string with values of class ids in ClassID (int) to set the property.
                         e.g. 0:2:3
                        flags: readable, writable, changeable only in NULL or READY state
                        String. Default: ""
  interval            : Specifies number of consecutive batches to be skipped for inference
                        flags: readable, writable, changeable only in NULL or READY state
                        Unsigned Integer. Range: 0 - 2147483647 Default: 0
  raw-output-generated-callback: Pointer to the raw output generated callback funtion
                        (type: gst_nvinfer_server_raw_output_generated_callback in 'gstnvdsinfer.h')
                        flags: readable, writable, changeable only in NULL or READY state
                        Pointer.
  raw-output-generated-userdata: Pointer to the userdata to be supplied with raw output generated callback
                        flags: readable, writable, changeable only in NULL or READY state
                        Pointer.

'embeded > jetson' 카테고리의 다른 글

nvidia jetson partition table  (0) 2022.04.06
jetson nano 부팅이 안됨  (0) 2022.04.06
deepstream part.3  (0) 2022.03.29
deepstream onnx part.2  (0) 2022.03.29
jetson nano python numpy Illegal instruction (core dumped)  (0) 2022.03.29
Posted by 구차니
embeded/jetson2022. 3. 29. 16:02

 

[링크 : https://github.com/NVIDIA-AI-IOT/deepstream_python_apps]

[링크 : https://github.com/NVIDIA-AI-IOT/deepstream_python_apps/tree/master/apps/deepstream-ssd-parser]

 

 

----

tritonserver for jetson (build)

[링크 : https://github.com/triton-inference-server/server/blob/main/docs/jetson.md]

 

+

[ 50%] Building CXX object CMakeFiles/triton-core.dir/backend_model_instance.cc.o
In file included from /home/jetson/work/server/build/_deps/repo-core-src/src/backend_model_instance.cc:37:0:
/home/jetson/work/server/build/_deps/repo-core-src/src/metrics.h:40:10: fatal error: dcgm_agent.h: No such file or directory
 #include <dcgm_agent.h>
          ^~~~~~~~~~~~~~
compilation terminated.

[링크 : https://github.com/NVIDIA/gpu-monitoring-tools/tree/master/bindings/go/dcgm]

  [링크 : https://github.com/NVIDIA/gpu-monitoring-tools]

 

pytorch 다운로드 경로

[링크 : https://jstar0525.tistory.com/171]

 

Known Issues
Triton PIP wheels for ARM SBSA are not available from PyPI and pip will install an incorrect Jetson version of Triton for ARM SBSA. The correct wheel file can be pulled directly from the ARM SBSA SDK image and manually installed.

[링크 : https://github.com/triton-inference-server/server/releases]

 

$ sudo docker pull nvcr.io/nvidia/tritonserver:21.11-py3-sdk

[링크 : https://zhuanlan.zhihu.com/p/471291236]

'embeded > jetson' 카테고리의 다른 글

jetson nano 부팅이 안됨  (0) 2022.04.06
deepstream triton server  (0) 2022.03.30
deepstream onnx part.2  (0) 2022.03.29
jetson nano python numpy Illegal instruction (core dumped)  (0) 2022.03.29
deepstream onnx  (0) 2022.03.28
Posted by 구차니
embeded/jetson2022. 3. 29. 11:32

생각해보니 deepstream onnx  github프로젝트의 경우

tiny_yolov2를 기반으로 작동하도록 libnvdsinfer_custom_bbox_tiny_yolo.so 를 생성했으니

ssd 와는 구조가 달라 당연히(?) 맞지 않으니 에러가 발생하고 죽는 듯.

[링크 : https://github.com/thatbrguy/Deep-Stream-ONNX]

 

ERROR: [TRT]: 2: [pluginV2DynamicExtRunner.cpp::execute::115] Error Code 2: Internal Error (Assertion status == kSTATUS_SUCCESS failed.)
ERROR: Build engine failed from config file
ERROR: failed to build trt engine.
0:08:17.537206102  9070     0x3f617730 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:08:17.545680634  9070     0x3f617730 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:08:17.545766053  9070     0x3f617730 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
0:08:17.546456543  9070     0x3f617730 WARN                 nvinfer gstnvinfer.cpp:841:gst_nvinfer_start:<primary_gie> error: Failed to create NvDsInferContext instance
0:08:17.546521285  9070     0x3f617730 WARN                 nvinfer gstnvinfer.cpp:841:gst_nvinfer_start:<primary_gie> error: Config file path: /home/jetson/work/Deep-Stream-ONNX/config/config_infer_custom_yolo.txt, NvDsInfer Error: NVDSINFER_CONFIG_FAILED
** ERROR: <main:658>: Failed to set pipeline to PAUSED

 

azure의 custom vision 의 README에 기재된 링크를 가보았는데

[링크 : https://github.com/Azure-Samples/customvision-export-samples]

 

onnx 포맷으로는 python과 c#만 제공하고

해당 사이트에서 python을 받아서 실행해보니 하나의 사진에 대해서 처리가 가능한 예제를 제공한다.

[링크 : https://github.com/Azure-Samples/customvision-export-samples/tree/main/samples/python/onnx]

[링크 : https://github.com/Azure-Samples/customvision-export-samples/tree/main/samples/csharp/onnx]

 

 

+

ssd deepstream 예제가 있는데

python 스크립트에 h264 elementary stream을 넣어주어야 한댄다

[링크 : https://github.com/NVIDIA-AI-IOT/deepstream_python_apps/tree/master/apps/deepstream-ssd-parser]

 

-h h264가 포인트 인 듯.

$ ffmpeg -f video4linux2 -s 320x240 -i /dev/video0 -vcodec libx264 -f h264 test.264

[링크 : https://stackoverflow.com/questions/27090114/what-does-elementary-stream-mean-in-terms-of-h264]

 

JVT NAL sequence, H.264 라는 타입으로 변경된 듯.

sample_0.h264: JVT NAL sequence, H.264 video @ L 31
sample_0.mp4:  ISO Media, MP4 v2 [ISO 14496-14]

 

Joint Video Team (JVT)
NAL: Network Abstraction Layer

[링크 : http://iphome.hhi.de/suehring/tml/JM%20Reference%20Software%20Manual%20(JVT-AE010).pdf]

 

+

sample_ssd_relu6.uff 파일은 ssd inception v2 기반 모델인가?

[링크 :  https://eva-support.adlinktech.com/docs/ssdnbspinception-v2-nbsp-nbsp-nbsp-nbspnbsp]

'embeded > jetson' 카테고리의 다른 글

deepstream triton server  (0) 2022.03.30
deepstream part.3  (0) 2022.03.29
jetson nano python numpy Illegal instruction (core dumped)  (0) 2022.03.29
deepstream onnx  (0) 2022.03.28
azure custom vision - precision, recall  (0) 2022.03.28
Posted by 구차니
embeded/jetson2022. 3. 29. 11:27

'embeded > jetson' 카테고리의 다른 글

deepstream part.3  (0) 2022.03.29
deepstream onnx part.2  (0) 2022.03.29
deepstream onnx  (0) 2022.03.28
azure custom vision - precision, recall  (0) 2022.03.28
flud nvidia cuda  (0) 2022.03.28
Posted by 구차니
embeded/jetson2022. 3. 28. 17:03

 

[링크 : https://towardsdatascience.com/how-to-deploy-onnx-models-on-nvidia-jetson-nano-using-deepstream-b2872b99a031]

git clone https://github.com/thatbrguy/Deep-Stream-ONNX.git
cd Deep-Stream-ONNX

wget https://github.com/onnx/models/blob/main/vision/object_detection_segmentation/tiny-yolov2/model/tinyyolov2-8.tar.gz
wget https://github.com/onnx/models/blob/main/vision/object_detection_segmentation/tiny-yolov2/model/tinyyolov2-8.tar.gz
# 구글 드라이브 다운로드

tar -xvf sample.tar.gz
tar -xvf tinyyolov2-7.tar.gz
cp tiny_yolov2/Model.onnx tiny_yolov2.onnx

cd custom_bbox_parser/
$ git diff
diff --git a/custom_bbox_parser/Makefile b/custom_bbox_parser/Makefile
index 5bab5a4..b764725 100644
--- a/custom_bbox_parser/Makefile
+++ b/custom_bbox_parser/Makefile
@@ -1,7 +1,8 @@
 CUDA_VER:=10
 SRCFILES:=nvdsparsebbox_tiny_yolo.cpp
 TARGET_LIB:=libnvdsinfer_custom_bbox_tiny_yolo.so
-DEEPSTREAM_PATH:=/home/nano/deepstream_sdk_v4.0_jetson
+#DEEPSTREAM_PATH:=/home/nano/deepstream_sdk_v4.0_jetson
+DEEPSTREAM_PATH:=/opt/nvidia/deepstream/deepstream-6.0

 ifeq ($(CUDA_VER),)
   $(error "CUDA_VER is not set")
diff --git a/custom_bbox_parser/nvdsparsebbox_tiny_yolo.cpp b/custom_bbox_parser/nvdsparsebbox_tiny_yolo.cpp
index c6251e5..0825e68 100644
--- a/custom_bbox_parser/nvdsparsebbox_tiny_yolo.cpp
+++ b/custom_bbox_parser/nvdsparsebbox_tiny_yolo.cpp
@@ -432,7 +432,7 @@ extern "C" bool NvDsInferParseCustomYoloV2Tiny(

     // Obtaining the output layer.
     const NvDsInferLayerInfo &layer = outputLayersInfo[0];
-    assert (layer.dims.numDims == 3);
+    assert (layer.inferDims.numDims == 3);

     // Decoding the output tensor of TinyYOLOv2 to the NvDsInferParseObjectInfo format.
     std::vector<NvDsInferParseObjectInfo> objects =

 

[링크 : https://github.com/thatbrguy/Deep-Stream-ONNX]

 

 

 *** DeepStream: Launched RTSP Streaming at rtsp://localhost:8554/ds-test ***

Opening in BLOCKING MODE
Opening in BLOCKING MODE

Using winsys: x11
WARNING: [TRT]: Detected invalid timing cache, setup a local cache instead
INFO: [Implicit Engine Info]: layers num: 2
0   INPUT  kFLOAT image           3x416x416
1   OUTPUT kFLOAT grid            125x13x13


Runtime commands:
        h: Print this help
        q: Quit

        p: Pause
        r: Resume

NOTE: To expand a source in the 2D tiled display and view object details, left-click on the source.
      To go back to the tiled display, right-click anywhere on the window.


**PERF:  FPS 0 (Avg)    FPS 1 (Avg)     FPS 2 (Avg)     FPS 3 (Avg)
**PERF:  0.00 (0.00)    0.00 (0.00)     0.00 (0.00)     0.00 (0.00)
** INFO: <bus_callback:194>: Pipeline ready

Opening in BLOCKING MODE
Opening in BLOCKING MODE
Opening in BLOCKING MODE
Opening in BLOCKING MODE
** INFO: <bus_callback:180>: Pipeline running



-------------------------------
0:00:00.369440298  8235     0x31571330 WARN                 nvinfer gstnvinfer.cpp:635:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::initialize() <nvdsinfer_context_impl.cpp:1161> [UID = 1]: Warning, OpenCV has been deprecated. Using NMS for clustering instead of cv::groupRectangles with topK = 20 and NMS Threshold = 0.5
ERROR: Deserialize engine failed because file path: /home/jetson/work/Deep-Stream-ONNX/config/../tiny_yolov2.onnx_b1_fp16.engine open error
0:00:01.781999412  8235     0x31571330 WARN                 nvinfer gstnvinfer.cpp:635:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:1889> [UID = 1]: deserialize engine from file :/home/jetson/work/Deep-Stream-ONNX/config/../tiny_yolov2.onnx_b1_fp16.engine failed
0:00:01.782126640  8235     0x31571330 WARN                 nvinfer gstnvinfer.cpp:635:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:1996> [UID = 1]: deserialize backend context from engine from file :/home/jetson/work/Deep-Stream-ONNX/config/../tiny_yolov2.onnx_b1_fp16.engine failed, try rebuild
0:00:01.782165021  8235     0x31571330 INFO                 nvinfer gstnvinfer.cpp:638:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:1914> [UID = 1]: Trying to create engine from model files
0:01:43.015792426  8235     0x31571330 INFO                 nvinfer gstnvinfer.cpp:638:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:1947> [UID = 1]: serialize cuda engine to file: /home/jetson/work/Deep-Stream-ONNX/tiny_yolov2.onnx_b1_gpu0_fp16.engine successfully
0:01:43.196589822  8235     0x31571330 INFO                 nvinfer gstnvinfer_impl.cpp:313:notifyLoadModelStatus:<primary_gie> [UID 1]: Load new model:/home/jetson/work/Deep-Stream-ONNX/config/config_infer_custom_yolo.txt sucessfully
NvMMLiteOpen : Block : BlockType = 261
NvMMLiteOpen : Block : BlockType = 261
NvMMLiteOpen : Block : BlockType = 261
NvMMLiteOpen : Block : BlockType = 261
NVMEDIA: Reading vendor.tegra.display-size : status: 6
NVMEDIA: Reading vendor.tegra.display-size : status: 6
NVMEDIA: Reading vendor.tegra.display-size : status: 6
NVMEDIA: Reading vendor.tegra.display-size : status: 6
NvMMLiteBlockCreate : Block : BlockType = 261
NvMMLiteBlockCreate : Block : BlockType = 261
NvMMLiteBlockCreate : Block : BlockType = 261
NvMMLiteBlockCreate : Block : BlockType = 261
NvMMLiteOpen : Block : BlockType = 4
NvMMLiteOpen : Block : BlockType = 4
===== NVMEDIA: NVENC =====
===== NVMEDIA: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
NvMMLiteBlockCreate : Block : BlockType = 4
H264: Profile = 66, Level = 0
H264: Profile = 66, Level = 0
NVMEDIA_ENC: bBlitMode is set to TRUE
NVMEDIA_ENC: bBlitMode is set to TRUE
 

'embeded > jetson' 카테고리의 다른 글

deepstream onnx part.2  (0) 2022.03.29
jetson nano python numpy Illegal instruction (core dumped)  (0) 2022.03.29
azure custom vision - precision, recall  (0) 2022.03.28
flud nvidia cuda  (0) 2022.03.28
jetson nano deepstream  (0) 2022.02.10
Posted by 구차니
embeded/jetson2022. 3. 28. 15:59

ms azure의 custon vision 서비스(?)를 이용해서 학습을 시도하는데

"하나의 태그당 15개 이상의 이미지 필요" 라는 제약조건이 걸려있다.

 

학습 시간에 따라서도 다르게 나오긴 한데

4시간 학습 걸어놨는데 1시간 조금 넘어서 멈춘걸 보면

학습치가 수렴하면 자동 종료하게 해둔 듯 한다.

 

 

 

 

 

precision이야 정확도일 것 같고, recall 번역이 안되네 -_ㅠ

"옳을 것으로 예상되어진 모든 태그들 중에 올바르게 찾은 퍼센트"

 

precision은 결과값에 대한 true가 true 인 조건

recall은 원본 데이터의 true에 대한 결과의 true가 true인 조건

 

+

Recall이 낮아졌다가 다시 높아졌는데 어느게 좋은건가 찾아보니 Precision과 Recall도 둘다 높은게 좋은거라고

[링크 : https://sumniya.tistory.com/26]

 

다운로드 받으면 metadata_properties.json 파일이 존재하는데 (tflite, onnx, onnx float16 확인)

학습시 별다른 옵션이 없던걸 봐서는 azure custom vision은 SSD 알고리즘만 지원하는 듯.

{
    "CustomVision.Metadata.AdditionalModelInfo": "",
    "CustomVision.Metadata.Version": "1.2",
    "CustomVision.Postprocess.Method": "SSD",
    "CustomVision.Postprocess.Yolo.Biases": "[]",
    "CustomVision.Postprocess.Yolo.NmsThreshold": "0.0",
    "CustomVision.Preprocess.CropHeight": "0",
    "CustomVision.Preprocess.CropMethod": "NoCrop",
    "CustomVision.Preprocess.CropWidth": "0",
    "CustomVision.Preprocess.MaxDimension": "0",
    "CustomVision.Preprocess.MaxScale": "0.0",
    "CustomVision.Preprocess.MinDimension": "0",
    "CustomVision.Preprocess.MinScale": "0.0",
    "CustomVision.Preprocess.NormalizeMean": "[0.0, 0.0, 0.0]",
    "CustomVision.Preprocess.NormalizeStd": "[1.0, 1.0, 1.0]",
    "CustomVision.Preprocess.ResizeMethod": "Stretch",
    "CustomVision.Preprocess.TargetHeight": "320",
    "CustomVision.Preprocess.TargetWidth": "320",
    "Image.BitmapPixelFormat": "Rgb8",
    "Image.ColorSpaceGamma": "SRGB",
    "Image.NominalPixelRange": "Normalized_0_1"
}

 

'embeded > jetson' 카테고리의 다른 글

jetson nano python numpy Illegal instruction (core dumped)  (0) 2022.03.29
deepstream onnx  (0) 2022.03.28
flud nvidia cuda  (0) 2022.03.28
jetson nano deepstream  (0) 2022.02.10
jetson nano developer board(구형) 부팅 문제  (0) 2022.02.09
Posted by 구차니
embeded/jetson2022. 3. 28. 15:02

nvidia jetson nano 4GB

 

--- 과거 아키이빙 이미지 끌어옴

nvidia ion

[링크 : https://minimonk.tistory.com/4579]

 

8800GT 혹은 8600GT 추정

[링크 : https://minimonk.tistory.com/2116]

'embeded > jetson' 카테고리의 다른 글

deepstream onnx  (0) 2022.03.28
azure custom vision - precision, recall  (0) 2022.03.28
jetson nano deepstream  (0) 2022.02.10
jetson nano developer board(구형) 부팅 문제  (0) 2022.02.09
nvidia jetson nano 2gb / csi  (0) 2022.01.21
Posted by 구차니