TensorRT part1 UFF Converter



在TensorRT使用前須要把先前的freezing graph轉換成.UFF(Universal File Format)

系統: ubuntu 16.04 LTS
硬體裝置:64-bit、GTX 680M

建議使用 English(United States)做為系統環境的語言
[純文字模式 中才不會因為路徑打不出中文而卡關--
Ubuntu主要分為兩個模式:
  1. 純文字模式/console:進入方式 Ctrl+Alt+F1~F6
  2. 視窗模式:進入方式 Ctrl+Alt+F7~F12
]

安裝 Nvidia Driver + cuda 8.0 + TensorRT 4.0
不確定是不是真的需要安裝driver 與 cuda 畢竟我的目的只是要轉檔(因為不支援windows😢)


First. 安裝Dirver
安裝Dirver時可能遇到 要求停用 X Server
這時需要切換到純文字模式且關閉X server
command:
sudo /etc/init.d/gdm stop    or  sudo /etc/init.d/kdm stop
sudo  sh NVIDIA_Linux-XXXXXXXXXXX.run


Second. 安裝TensorRT4.0裡的 uff-convert-tf
如果無法順利安裝,可在var中找到分散tensorRT安裝檔,只需要順利將uff-convert-tf_XXX.deb安裝就可以了


Third. 安裝 tensorflow
# 安裝pip3
sudo apt-get update
sudo apt-get install python3-pip

#安裝 tensorflow-gpu
sudo pip install tensorflow-gpu

#安裝 tensoflow(cpu)
sudo pip3 install tensorflow


Fourth. convert pb to uff
Command:
python3
import tensorflow
import uff
uff.from_tensorflow_frozen_model("filepath.pb",output_filename="output_path.uff")


Good luck mates.~


留言

這個網誌中的熱門文章

Optix Ray Tracing 基本概念流程

使用Visual Studio建置optix專案

freezing Keras model