CPU和GPU平台的Pytorch的需求。
我正在尝试创建一个unignts.txt
以使用pytorch
,但希望它可以在GPU和非GPU平台上使用。
我在Linux GPU系统上做类似的操作:
--find-links https://download.pytorch.org/whl/cu113/torch_stable.html
torch==1.10.2+cu113
torchvision==0.11.3+cu113
pytorch-lightning==1.5.10
这可以正常工作并且安装了软件包,并且可以使用启用GPU的Pytorch。
我想知道如何对Mac和Non GPU用户进行修改,以安装torch
和torchvision
的非CUDA软件包?我需要维护单独的sumplions.txt
文件吗?
I am trying to create a requirements.txt
to use pytorch
but would like it to work on both GPU and non-GPU platforms.
I do something like on my Linux GPU system:
--find-links https://download.pytorch.org/whl/cu113/torch_stable.html
torch==1.10.2+cu113
torchvision==0.11.3+cu113
pytorch-lightning==1.5.10
This works fine and the packages are installed and I can use the GPU-enabled pytorch.
I wonder how I can modify this for the mac and non GPU users to install the non cuda package for torch
and torchvision
? Do I need to maintain separate requirements.txt
files?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
更多
发布评论
评论(1)
2024年2月更新
检查 https://pytorch.org/ 。您会看到“ CUDA在MacOS上不可用,请使用默认软件包”。但是,您仍然可以通过安装 mps来获得性能提升(这将取决于您的硬件) Pytorch的加速版本:
可以在此处生成此命令: https://pytorch.org/
,为了在不同平台上安装不同的火炬版本,您可以在
sumplions.txt
中使用有条件的版本。 MacOS上的加速版
February 2024 update
Check https://pytorch.org/. You will see that "CUDA is not available on MacOS, please use default package". However, you can still get performance boosts (this will depend on your hardware) by installing the MPS accelerated version of pytorch by:
This command can be generated here: https://pytorch.org/
And in order to install different Torch versions on different platforms you can use conditionals in your
requirements.txt
like thisThis will install CUDA enabled torch and torchvision on Linux but the MPS accelerated version of them on MacOS