Install torchtext with pytorch 1.13.1 with cuda 11.7

huangapple go评论66阅读模式
英文:

Install torchtext with pytorch 1.13.1 with cuda 11.7

问题

I currently have PyTorch 1.13.1 with CUDA 11.7 installed and it's working perfectly fine. However, when I try to install TorchText using 'pip install torchtext', it automatically installs PyTorch 2 which causes issues with my existing code that relies on PyTorch 1.13.1 with CUDA 11.7.

When I attempt to install an older version of TorchText, such as 0.14.0, it automatically uninstalls my current version of PyTorch and installs PyTorch 1.13.0 without GPU support.

Is there a way for me to install TorchText without upgrading my PyTorch version and while keeping my CUDA and PyTorch installations intact?

英文:

I currently have PyTorch 1.13.1 with CUDA 11.7 installed and it's working perfectly fine. However, when I try to install TorchText using 'pip install torchtext', it automatically installs PyTorch 2 which causes issues with my existing code that relies on PyTorch 1.13.1 with CUDA 11.7.

When I attempt to install an older version of TorchText, such as 0.14.0, it automatically uninstalls my current version of PyTorch and installs PyTorch 1.13.0 without GPU support.

Is there a way for me to install TorchText without upgrading my PyTorch version and while keeping my CUDA and PyTorch installations intact?

答案1

得分: 2

你可以尝试安装

pip install torchtext==0.14.0 --no-deps

它依赖于Pytorch 1.13.0,而你已经安装了1.13.1,所以应该可以正常工作。

如果不起作用,很可能需要降级Pytorch

pip3 install -U torch==1.13.0+cu117 torchtext==0.14.0 --extra-index-url https://download.pytorch.org/whl/cu117
英文:

You can try

pip install torchtext==0.14.0 --no-deps

It depends on Pytorch 1.13.0 and you already have 1.13.1 installed so it should work fine.

If it does not work, you will most probably need to downgrade Pytorch

pip3 install -U torch==1.13.0+cu117 torchtext==0.14.0 --extra-index-url https://download.pytorch.org/whl/cu117

huangapple
  • 本文由 发表于 2023年4月19日 19:08:37
  • 转载请务必保留本文链接:https://go.coder-hub.com/76053795.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定