[deepstream][原创]deepstream:5.1-21.02-triton的docker无法使用pytorch

197 篇文章 20 订阅
15 篇文章 1 订阅

deepstream:5.1-21.02-triton的docker安装pytorch后会提示

libtorch_cuda_cpp.so: undefined symbol

参照Unable to Import PyTorch - #4 by mchi - DeepStream SDK - NVIDIA Developer Forums解决方法

it’s caused by PyTorch version incompatibilities.
After installing torch, remove “/opt/tritonserver/lib/pytorch/” from the LD_LIBRARY_PATH, torch can then work, otherwise it will links to the lib under /opt/tritonserver/lib/pytorch/ and the failed due to incompatibilities. But, after changing LD_LIBRARY_PATH, nvinferserver plugin can’t work then.

According to Release Notes :: NVIDIA Deep Learning Triton Inference Server Documentation 1, triton is using a dedicated Pytorch repo: triton-inference-server/pytorch_backend 1, so the incompatibility may be expected.

May I know why you need torch in DS docker?

# pip3 install torch==1.8.1+cpu torchvision==0.9.1+cpu torchaudio===0.8.1 -f https://download.pytorch.org/whl/lts/1.8/torch_lts.html
# export LD_LIBRARY_PATH=/usr/src/tensorrt/lib:/opt/jarvis/lib/:/opt/kenlm/lib/:/usr/local/cuda/compat/lib:/usr/local/nvidia/lib:/usr/local/nvidia/lib64
# python3 -c "import torch; print(torch.__version__)"
1.8.1+cpu
您好!要在 Docker 中部署 DeepStream 6.1 和 YOLOv5,您可以按照以下步骤进行操作: 1. 首先,安装 Docker 并确保其正常运行。 2. 创建一个新的 Docker 容器,可以使用以下命令: ``` docker run --gpus all --name deepstream-yolov5 -it -v /path/to/your/app:/app nvcr.io/nvidia/deepstream:6.1-21.02-triton ``` 这将创建一个名为 "deepstream-yolov5" 的容器,并将宿主机的 "/path/to/your/app" 目录挂载到容器内的 "/app" 目录中。这个命令使用了 NVIDIA 的 DeepStream 6.1 镜像。 3. 进入容器内部: ``` docker exec -it deepstream-yolov5 bash ``` 4. 在容器内,安装 YOLOv5。可以按照 YOLOv5 的官方文档进行操作,一般是执行以下命令: ``` git clone https://github.com/ultralytics/yolov5.git cd yolov5 pip install -r requirements.txt ``` 这将克隆 YOLOv5 仓库,并安装所需的依赖项。 5. 下载 YOLOv5 的预训练权重文件。您可以从 YOLOv5 的发布页面上下载预训练权重文件,并将其放在 "/app" 目录下。 6. 在 DeepStream使用 YOLOv5。您可以根据 DeepStream 的文档进行配置和使用 YOLOv5。一般来说,您需要修改 DeepStream 的配置文件以使用 YOLOv5 模型,并指定预训练权重文件的路径。 7. 运行 DeepStream。根据您的具体需求,您可以运行 DeepStream 以开始使用 YOLOv5 进行目标检测。 这些是一般的步骤,具体的操作可能因您的环境和需求而有所不同。请确保您已经安装了必要的依赖项,并根据文档进行相应的配置。祝您成功部署 DeepStream 6.1 和 YOLOv5!如有更多问题,请随时提问。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

FL1623863129

你的打赏是我写文章最大的动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值