[TensorRT] TensorRT custom layer
예를 들어, "ResizeBilinear" 레이어는 TensorRT 에서 지원하지 않는 레이어이다. TensorRT에서 지원되지 않는 레이어 목록 : https://docs.nvidia.com/deeplearning/sdk/tensorrt-developer-guide/index.html#support_op TensorRT Developer Guide :: Deep Learning SDK Documentation NVIDIA DLA (Deep Learning Accelerator) is a fixed function accelerator engine targeted for deep learning operations. DLA is designed to do full hardware acceleration ..
2019.06.13
[TensorRT] ImportError: No module named 'tensorrt.parsers'; 'tensorrt' is not a package
아래와 같은 에러는 ImportError: No module named 'tensorrt.parsers'; 'tensorrt' is not a package TensorRT 예제에서 아래코드와 같이 tensorrt.parsers 의 uffparser를 import 하여 uff 파일을 로드하고 builder 를 생성하였을 때 나는 에러이다. import tensorflow as tf import tensorrt as trt from tensorrt.parsers import uffparser uff_model = uff.from_tensorflow(tf_model, ["fc2/Relu"]) G_LOGGER = trt.infer.ConsoleLogger(trt.infer.LogSeverity.ERROR) p..
2019.06.10
no image
[TensorFlow] pb 파일 TensorBoard에 띄우기 (TF 1.x 버전용)
import_pb_to_tensorboard.py # Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distribute..
2019.05.31
[CUDA] CUDA Capability 확인
CUDA 를 설치하면 아래와 같은 경로에 접속하여 ./deviceQuery 라는 명령어로 CUDA 정보를 확인 할 수 있다. 필자의 경우는 cuda 10.0 버전을 설치하였으므로 아래와 같은 경로에 들어갔고, 다른 버전인 경우 숫자를 바꾸어 폴더에 진입한다. $ cd /usr/local/cuda-10.0/samples/1_Utilities/deviceQuery sudo make $ sudo make /usr/local/cuda-10.0/bin/nvcc -ccbin g++ -I../../common/inc -m64 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 ..
2019.05.31
no image
[TensorRT] TensorRT를 이용한 ResNet 예제
TensorRT는 추론 최적화 도구이다. 미리 만들어져있는 실행 그래프 파일 (.pb) 을 이용하여 추론을 수행한다. https://github.com/tensorflow/models/tree/master/research/tensorrt tensorflow/models Models and examples built with TensorFlow. Contribute to tensorflow/models development by creating an account on GitHub. github.com TensorFlow 에 내장되어있는 tensorrt 모델을 이용하여 간단한 예제를 실행 할 수 있다. 미리 트레이닝된 TensorFlow SavedModel 을 Frozen Graph로 변환 추론을 위해 F..
2019.04.12
[TensorRT] TensorRT support Python2.7, 3.5
TensorRT 는 현재까지 Python 2.7, Python 3.5 만을 지원한다. https://devtalk.nvidia.com/default/topic/1043215/tensorrt/tensorrt-import-undefined-symbol/ https://devtalk.nvidia.com/default/topic/1043215/tensorrt/tensorrt-import-undefined-symbol/ devtalk.nvidia.com https://devtalk.nvidia.com/default/topic/1035558/tensorrt/tensorrt-for-python-3-6-/ https://devtalk.nvidia.com/default/topic/1035558/tensorrt/tenso..
2019.04.12
no image
[TensorRT] Docker Container를 이용한 TensorRT 설치
TensorRT 레퍼런스에 나와있는대로 Root에 설치했으나 python dependency 문제로 인해 실행되지 않았다. TensorRT 5.0.2.6 (CUDA 10.0) 버전을 설치했는데 자꾸 아래와 같이 CUDA 9.0를 찾지를 않나 ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory TensorRT를 못찾는 에러가 나와서 NVIDIA 답변을 보니 Container를 사용하라고 한다. ImportError: /usr/local/anaconda3/lib/python3.6/site-packages/tensorrt/tensorrt.so: undefined symbol: _Py_ZeroStruct ..
2019.04.10
[TensorRT] TensorRT 5.0.2 Compatibility
TensorRT 5.0.2의 Python Sample 은 yolov3_onnx, uff_ssd 가 있다고 한다. 제일 중요한 Compatibility 는 다음과 같다. TensorRT 5.0.2.6 Compatibility TensorRT 5.0.2 has been tested with cuDNN 7.3.1. TensorRT 5.0.2 has been tested with TensorFlow 1.9. This TensorRT release supports CUDA 10.0 and CUDA 9.0. CUDA 8.0 and CUDA 9.2 are no longer supported. On Windows only, CUDA 10.0 is supported for TensorRT 5.0.1 RC. 원문은 아래와..
2019.04.09
[TensorRT] Object Detection With The ONNX TensorRT Backend In Python
TensorRT 샘플인 yolov3_onnx 를 돌려보았다. 샘플 파일 위치 : .........../TensorRT-5.0.2.6/samples/python/yolov3_onnx 이 샘플은 python 3 와 Ubuntu14.04 이전 버전을 지원하지 않음 주의 1. TensorRT 설치 2019/04/09 - [Deep Learning/TensorRT] - [TensorRT] TensorRT 설치 2. Onnx 설치 (필자는 루트환경에 설치했으므로 sudo 를 사용) python2 -m pip install onnx==1.2.2 3. requirements.txt 설치 python2 -m pip install -r requirements.txt 4. yolov3_to_onnx.py 코드 실행 (한번만..
2019.04.09
[TensorRT] TensorRT 설치
Nvidia TensorRT 는 GPU에서 고성능 추론을 용이하게 해주는 C++ 라이브러리이다. TensorRT는 일련의 네트워크 및 매개변수 들로 구성된 네트워크를 사용하여 기존에 존재하는 네트워크를 고도로 최적화 시킬 수 있다. 현재 TensorRT는 CUDA 9.0, 10.0, 10.1 을 지원할 수 있고 TensorFlow에서 TensorRT 모델로 변환하려면 TensorFlow 1.12.0 버전이 필요하다고 한다. 또한 TesnorRT 는 sudo나 root 에 설치해야하며 anaconda 와 같은 가상환경을 사용할 경우 tensorRT가 설치된 곳을 제어 할 수 없다고 한다. anaconda + python 2.7 을 이용하면 될 수 도 있다고 하는데 시도해보니 실패 1. TensorRT 파일..
2019.04.09
[TensorFlow] Anaconda 가상환경 이용하여 TensorFlow GPU 설치
아나콘다 설치 후 1. 가상환경 생성conda create -n 가상환경이름 python=3.6 2. 가상환경 Activationsource activate 가상환경이름 3. TensorFlow GPU 설치conda install -c anaconda tensorflow-gpu (2019년 3월 5일 기준 )이렇게 설치하면 현재 아나콘다 패키지에 나와있는 최신 버전인 TensorFlow 1.12 버전으로 설치되며CUDA 9.2, cuDNN 7.2.1 로 설정된다.필자는 CUDA 10.0 버전이 설치된 상태에서 가상환경을 위와 같이 설정하였다. 텐서플로우 GPU 버전 패키지 확인 https://anaconda.org/anaconda/tensorflow-gpu/files 3-1. TensorFlow GPU ..
2019.03.05
no image
[Tensorflow] Tensorflow GPU 버전 설치하기
3일의 삽질이 끝났다... 나중에 참고하려고 써보는 포스팅이다. 버전이 참 중요하다고 새삼느꼈다. 수많은 버전 충돌로 인한 에러를 충분히 겪고 쓰는 포스팅이 많은 사람들에게 도움이 되길 바라며... 설치 환경 - Windows 10 / 64 bits - Anoconda 4.3 - Visual Studio 2015 새로 설치한 환경 - CUDA 8.0 - cuDNN 6- Tensorflow 1.4 설치 순서는 아래와 같다.아나콘다 - 비주얼 스튜디오(필요시) - CUDA - CuDNN - Tensorflow * 참고로 Tensorflow 1.5 버전은 CUDA 9.0 이 필요하고,* Tensorflow 1.3 버전 부터는 cuDNN 6 버전이 필요하다. * Tensorflow 1.5 버전이 릴리즈 되었다고..
2018.01.11