pytorch与cuda与TensorRT的版本选择

VScode版本

linux最新版本的vscode,可能无法进行python的调试
在这里插入图片描述
选择下载1.85 https://code.visualstudio.com/updates/v1_85

CUDA版本

在这里插入图片描述

https://developer.nvidia.com/Cuda-Toolkit-archive

由于受限于TRT的8.6(下面会说明),所以CUDA Version最高为: 12.1,而pytorch的限制只能是12.1或者是11.8。
重装cuda toolkit后,须重装pytorch

Pytorch版本

在这里插入图片描述
https://pytorch.org/get-started/locally/

选择12.1

conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia

TensorRT版本

在这里插入图片描述
https://developer.nvidia.com/tensorrt/download
受限于CentOS7版本,trt最高为8.6。

安装后的提示,配置路径与卸载命令:

Please make sure that
 -   PATH includes /usr/local/cuda-12.0/bin
 -   LD_LIBRARY_PATH includes /usr/local/cuda-12.0/lib64, or, add /usr/local/cuda-12.0/lib64 to /etc/ld.so.conf and run ldconfig as root

To uninstall the CUDA Toolkit, run cuda-uninstaller in /usr/local/cuda-12.0/bin
To uninstall the NVIDIA Driver, run nvidia-uninstall

报错

nn.Conv1d运算报错

在pytorch中使用 nn.Conv1d 算子,会报错:
[1] 17446 segmentation fault python test.py

这个网上无法搜到的问题,就是版本不匹配导致的问题,重装一遍cuda与pytorch。</

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值