没有名为“uff”的模块

Sai*_*das 2 python tensorflow tensorrt uff

目标: 将 tensorflow .pb 模型转换为 tensorrt

系统规格: Ubundu 18.04 Cuda 10.0 TensorRT 5.1

连安装 sudo apt-get install uff-converter-tf

尝试uff在 Python 中导入时出错:

ModuleNotFoundError: 没有名为“uff”的模块

Luk*_*ski 5

安装uff-converter-tf是不够的,您需要安装 Python UFF 轮才能使用它。在这里您将找到完整的安装指南。

如果使用 Python 2.7:

pip2 install tensorrt-*-cp27-none-linux_x86_64.whl
Run Code Online (Sandbox Code Playgroud)

如果使用 Python 3.x:

pip3 install tensorrt-*-cp3x-none-linux_x86_64.whl
Run Code Online (Sandbox Code Playgroud)

你会发现这些轮子和其他由解包产生的 TensorRT 二进制文件TensorRT-${version}.${os}.${arch}-gnu.${cuda}.${cudnn}.tar.gz

与往常一样,最好安装在虚拟环境中。

  • @SaiKrishnadas 事实并非如此。下载适当版本的 tar.gz 并从那里开始操作。 (2认同)