简体   繁体   English

如何离线安装Pytorch?

[英]How do I install Pytorch offline?

I need to install Pytorch on a computer with no internet connection. 我需要在没有互联网连接的计算机上安装Pytorch。

I've tried finding information about this online but can't find a single piece of documentation. 我尝试过在线查找有关此信息,但找不到任何文档。

Do you know how I can do this? 你知道我该怎么做吗? Is it even possible? 可能吗

An easy way with pip : 点子的简单方法:

  • Create an empty folder 创建一个空文件夹
  • pip download torch using the connected computer. 使用已连接的计算机pip download torch You'll get the pytorch package and all its dependencies. 您将获得pytorch软件包及其所有依赖项。
  • Copy the folder to the offline computer. 将文件夹复制到脱机计算机。 You must be using the same python setup on both computers (this goes for virtual environments as well) 您必须在两台计算机上都使用相同的python设置(这也适用于虚拟环境)
  • pip install * on the offline computer, in the copied folder. 在脱机计算机上复制的文件夹中pip install * This installs all the packages in the correct order. 这将以正确的顺序安装所有软件包。 You can then use pytorch. 然后,您可以使用pytorch。

Note that this works for (almost) any kind of python package. 请注意,这几乎适用于任何类型的python包。

Download source of pytorch from https://github.com/pytorch/pytorch https://github.com/pytorch/pytorch下载pytorch的源代码

Then follow the tutorial named: Install PyTorch 然后按照教程命名:安装PyTorch

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM