pytorch macos

The installation of PyTorch is pretty straightforward and can be done on all major operating systems. However, if you want to get your hands dirty without actually installing it, Google Colab provides a good starting point.

PyTorch的安装非常简单,可以在所有主要操作系统上完成。 但是,如果您想在不进行实际安装的情况下弄脏手,则Google Colab提供了一个很好的起点。

Colab comes with preinstalled PyTorch and Tensorflow modules and works with both GPU and TPU support.

Colab随附了预装的PyTorch和Tensorflow模块,并与GPU和TPU支持一起使用。

For installation on your own computer, PyTorch comes with both the CUDA and no CUDA versions, depending upon the hardware available to you.

为了在您自己的计算机上安装,PyTorch随附CUDA和不提供CUDA版本,具体取决于您可用的硬件。

This will be a single step installation – PyTorch Start Locally.

这将是一步安装– PyTorch Local Local 。

Prerequisite: Anaconda Distribution (Link to official website) – You need Anaconda installed on your system to follow this tutorial. The download packages are available for all major operating systems and the process of installation is very straight forward.

先决条件: Anaconda发行版(链接到官方网站) –您需要在系统上安装Anaconda才能遵循本教程。 下载包适用于所有主要操作系统,安装过程非常简单。

So before you go ahead with the tutorial, make sure you have an up and running Anaconda distribution set up on your operating system.

因此,在继续学习本教程之前,请确保已在操作系统上建立并运行了Anaconda发行版。

Note: In case you don’t want to use Anaconda, you can always use PIP to install PyTorch. Since PIP comes bundled with Python installer, you will already have it in your system.

注意 :如果您不想使用Anaconda,则可以始终使用PIP安装PyTorch。 由于PIP与Python安装程序捆绑在一起,因此您已经将其安装在系统中。

在Windows上安装Pytorch (Install Pytorch on Windows)

The PyTorch website provides the following command for the windows system. PyTorch works with Windows 7 or higher and uses Python 3 or higher. Installing it using Anaconda is quite simple and can be done in a few minutes.

PyTorch网站为Windows系统提供以下命令。 PyTorch可在Windows 7或更高版本上使用,并使用Python 3或更高版本。 使用Anaconda进行安装非常简单,只需几分钟即可完成。

PyTorch Installation 1
PyTorch安装1

The next step is to paste the following command in your Anaconda prompt and run it.

下一步是将以下命令粘贴到Anaconda提示符中并运行它。


conda install pytorch torchvision cpuonly -c pytorch

The prompt will list out all the dependencies that will be installed along with PyTorch. If you are okay to proceed, type yes in the command line.

该提示将列出将与PyTorch一起安装的所有依赖项。 如果可以继续,请在命令行中输入yes。

PyTorch Installation 2
PyTorch安装2

Anaconda now proceeds with the installation. You can check the installation through the Python interpreter or a Jupyter Notebook later.

Anaconda现在继续安装。 您可以稍后通过Python解释器或Jupyter Notebook检查安装。

PyTorch Version
PyTorch版本

Now you have successfully installed PyTorch on your Windows system.

现在,您已经在Windows系统上成功安装了PyTorch。

在Linux上安装PyTorch (Installing PyTorch on Linux)

If you open the same installation page from a Linux machine, you will notice that the generated command will be a different one.

如果从Linux机器打开相同的安装页面,则会注意到生成的命令将是不同的命令。

PyTorch Linux
PyTorch Linux

The next step is to copy and paste the command into your terminal and run it.

下一步是将命令复制并粘贴到终端中并运行它。


conda install pytorch torchvision cpuonly -c pytorch
Pytorch Ubuntu Installation
Pytorch Ubuntu安装

The terminal asks you for permission to install/update packages. You need to press yes as a response.

终端会要求您许可安装/更新软件包。 您需要按

Pytorch Ubuntu Packages
Pytorch Ubuntu软件包

The installation will now continue to install torch and torchvision packages into your environment.

现在,安装将继续将TorchTorchvision软件包安装到您的环境中。

Pytorch Ubuntu Progress
Pytorch Ubuntu进展

在Mac OS上安装PyTorch (Installing PyTorch on Mac OS)

We will use PIP to install PyTorch in Mac OS. All we need is to select the appropriate options on the PyTorch home page to get the install command.

我们将使用PIP在Mac OS中安装PyTorch。 我们所需要做的就是在PyTorch主页上选择适当的选项以获取安装命令。

Pytorch Quick Start Locally Mac Os
Pytorch本地快速入门Mac OS

So, we have to run the following command to install PyTorch and torchvision libraries on Mac OS.

因此,我们必须运行以下命令在Mac OS上安装PyTorch和torchvision库。


$ pip3.7 install torch torchvision

Here is the output from the Terminal when the above command is executed.

这是执行上述命令时来自终端的输出。

Pip Install Torch
点安装火炬

The last line of the output clearly states that both torch and torchvision packages are successfully installed.

输出的最后一行清楚地表明,torch和torchvision软件包都已成功安装。

Let’s launch the Python 3.7 interpreter and print the torch version to confirm the successful installation.

让我们启动Python 3.7解释器并打印割炬版本以确认安装成功。


$ python3.7
Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 16:52:21)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> print(torch.__version__)
1.4.0
>>>
Python Print Torch Version
Python Print Torch版本

结论 (Conclusion)

PyTorch is a very powerful machine learning framework. It’s used a lot in creating deep learning by processing large amounts of data. We will look into more features of PyTorch in the upcoming tutorials.

PyTorch是一个非常强大的机器学习框架。 它通过处理大量数据在创建深度学习中使用了很多方法。 我们将在接下来的教程中研究PyTorch的更多功能。

翻译自: https://www.journaldev.com/35965/pytorch-installation

pytorch macos

pytorch macos_Windows,Linux和MacOS上的PyTorch安装相关推荐

  1. oracle8ir2,Oracle8iR2(oracle8.1.6)在redhat linux 7.1上的简易安装方法

    Oracle8iR2(oracle8.1.6)在redhat linux 7.1上的简易安装方法 时间:2006/7/19 2:15:17 作者:佚名 人气:78 安装oracle我也走了许多弯路,前 ...

  2. MacOS上快速下载安装brew

    推荐大家使用国内镜像源,在MacOS上快速下载安装brew 复制下面这段命令到终端,进入自动安装脚步步骤,选择国内镜像源编号 1.中科大下载源 (推荐)2.清华大学下载源 3.北京外国语大学下载源 4 ...

  3. qtiplot编译失败linux,在macOS上安装 qtiplot 免费版

    8种机械键盘轴体对比 本人程序员,要买一个写代码的键盘,请问红轴和茶轴怎么选? 最近更新时间:2019-10-04 一.简介 众所周知,对于广大科研狗来说,origin是一款不可多得的使用软件,但or ...

  4. macos 查找文件_如何在Windows和macOS上查找和安装颜色配置文件以获取更准确的显示器...

    macos 查找文件 Color profiles, also known as ICC or ICM files, contain a collection of settings that hel ...

  5. GDB基础:MacOS上的GDB安装与设定

    这篇文章介绍一下MacOS下GDB的安装与设定方法.在MacOS上使用LLDB可能会更方便一些,但是对于习惯gdb的用于以及LLDB无法完成的地方,GDB还是有很多优势的. 目录 环境说明 安装与确认 ...

  6. Aria2 在 macOS 上的详细安装教程!

    安装和设置 Aria2 # 使用 Homebrew 安装 aria2 brew install aria2# 创建配置文件aria2.conf和空对话文件aria2.session mkdir ~/. ...

  7. python 安装xgboost_如何在macOS上为Python安装XGBoost?

    教程概述 本教程分为以下3个部分: 1.安装MacPorts: 2.构建XGBoost: 3.安装XGBoost. 注意:我在一系列不同的macOS版本上都是使用这个过程.本教程是在macOS Hig ...

  8. 【vcpkg】vcpkg:用于 Windows、Linux 和 macOS 的 C++ 包管理器

    官网:https://docs.microsoft.com/zh-cn/cpp/build/vcpkg?view=msvc-160&viewFallbackFrom=vs-2019 vcpkg ...

  9. macos 上的各种下载软件安装方式

    不知道为什么,macos上的各种安装软件的工具都没有默认安装,如brew,且安装过程非常费劲. 这里终于找到一个中文的,一键安装脚本,特记录如下: 1.安装brew /bin/zsh -c " ...

最新文章

  1. 2019年10个最受欢迎的JavaScript动画库!
  2. SpringBoot+Vue 完整的外卖系统,手机端和后台管理,可以玩一下!
  3. 农业部部署农业大数据发展工作 评:对农业现代化很重要
  4. 施一公“开学第一课”金句频出!这堂硬核公开课讲了啥?
  5. php7.0扩展yac,php扩展之yac安装
  6. 95-908-030-源码-FlinkTable-Table API
  7. python装饰器的顺序_python中装饰器的装饰顺序和执行顺序
  8. SGU 231 Prime Sum 求lt;=n内有多少对素数(a,b)使得a+b也为素数 规律题
  9. HashMap、LinkedHashMap、HashTable、HashSet笔记
  10. LAMP使开放源代码软件安全性提高
  11. magisk下载里显示没有模块_magisk框架
  12. SOLD2算法详解之2: 特征点检测,点NMS(CVPR 2021)
  13. 开发Android系统应用
  14. 微信公众号oauth授权
  15. redis.conf配置详细解析
  16. 苹果2021新品发布会,iMac全新设计你GET到了吗
  17. 怎么教你如何查看电脑的蓝牙版本【解决方案】
  18. [AGC004E] Salvage Robots (DP)
  19. Java程序中操作Word表格
  20. 0506-Scrum 项目 2.0视频

热门文章

  1. 斯蒂芬-如何选择约会地点大大增加约会成功机率的干货贴
  2. Objective-C 与JAVA的SHA1/HmacSHA1加密算法实现
  3. Js整理工具-开发必备
  4. Linux性能监控(转)
  5. vscode-go 插件安装
  6. java异常处理和自定义异常利用try和catch让程序继续下去(回来自己再写个例子试运行下)...
  7. nodejs 中es5 模块的几种写法
  8. 菜鸟学习Spring——SpringMVC注解版解析不同格式的JSON串
  9. .NET数据提供程序
  10. 【Proteus仿真】220V转5V向单片机供电