• Stars
    star
    145
  • Rank 252,863 (Top 6 %)
  • Language
    C
  • License
    MIT License
  • Created almost 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Off-the-shelf python package of pytorch with CUDA support for Mac OS

Pytorch OSX Build

Unfortunately, the Pytorch team does not release binary package for Mac OS with CUDA support. This project provides off-the-shelf binary packages.

很不幸,Pytorch团队不发布 Mac OS CUDA版。本项目提供 Mac OS 上编译好、可直接安装的Pytorch CUDA版本。

Performance Warning

【2020.02.18】I benchmarked Pytorch 1.3.1 with CUDA 10.1 and CUDNN 7.6.5 on Mac OS X 10.13.6 and Ubuntu 16.04, performance on Mac OS is around 2/3 of that on Ubuntu. In addition, it is more likey to encounter "CUDA OUT OF MEMORY" error on Mac OS since the operating system takes a large amount of GPU memory for display. Be aware of this performance difference and if you have a lot of data to process, you would better turn to Ubuntu!

The following table lists training time of MNIST image classification demo.

Settings Single GPU Dual GPUs
Ubuntu 1080Ti 99.76 s 50.99 s
MacOS 1080Ti 156 s 82 s

Compile Yourself

If you find the releases cannot meet your requirements, you can compile from source youreself.

  • Guides are avaiable:
  • Source pathces are availabe at source_pathes folder of the master branch.

Releases

You can find releases in release page.

你可以在Release页面找到发布版本。

Installation for Python 2.7 (Outedated)

First, ensure your CUDA driver and cudnn is installed properly, and copy dependencies in folder usr_local_lib to path /usr/local/lib. Also, install OpenMP using Homebrew.

首先,确保CUDA驱动和cudnn正确安装,并且将文件夹usr_local_lib中的依赖项复制到路径/usr/local/lib。也要通过Homebrew安装OpenMP。

sudo mkdir /usr/local
sudo mkdir /usr/local/lib
sudo cp usr_local_lib/* /usr/local/lib/
brew install libomp
brew link --overwrite libomp

Second, uninstall the previous pytorch installtion by

其次,卸载之前版本的pytorch:

pip uninstall torch

Install the wheel package from this project:

安装:

pip install torch*.whl

Install torchvision:

安装torchvision:

pip install -U torchvision

Installation for Python 3

Install Python 3.x from Homebrew first, and then simply follow the guide for Python 2.7 and replace pip command with pip3 and python with python3.

首先从Homebrew安装Python 3.x,然后按照Python 2.7的安装步骤执行,注意将pip替换为pip3,并用python3启动python

Enjoy!

开始使用Pytorch吧!

Source Code

Source code from: https://github.com/pytorch/pytorch

Related Links

If you need Tensorflow builds for osx, go to this page: https://github.com/TomHeaven/tensorflow-osx-build

If you need MxNet builds for osx, go to this page: https://github.com/TomHeaven/mxnet_osx_build

如果你需要Tensorflow包,请看这个页面:https://github.com/TomHeaven/tensorflow-osx-build

如果你需要MxNet包,请看这个页面:https://github.com/TomHeaven/mxnet_osx_build

More Repositories

1

nudt_thesis

NUDT硕士博士毕业论文latex模板
TeX
161
star
2

tensorflow-osx-build

Off-the-shelf python package of tensorflow with CUDA support for Mac OS.
142
star
3

HoRNDIS

Tom's Repo of HoRNDS——the USB tethering driver for Mac OS 11+
C++
101
star
4

nudtproposal

NUDT硕士博士研究生开题报告latex模板
TeX
82
star
5

Joint-Demosaic-and-Denoising-with-ADMM

[2017] Code for ICIP 2017 paper JOINT DEMOSAICING AND DENOISING OF NOISY BAYER IMAGES WITH ADMM
MATLAB
64
star
6

msba_reid

[2020] Official code for paper "MSBA: Multiple Scales, Branches and Attention Network With Bag of Tricks for Person Re-Identification"
Python
23
star
7

AnomalyAnalysisWithOpticalFlow

[2016] A project for video anomaly detection of our ICASSP 2016 paper.
C++
20
star
8

wiznote-release-for-linux

为知笔记Linux版
Shell
15
star
9

Dark-Channel-Haze-Removal-with-CUDA

Dark channel Haze removal algorithm with CUDA acceleration (typically 10x or more speedup using a Nvidia GPU)
Cuda
14
star
10

Pixel-wise-Estimation-of-Signal-Dependent-Image-Noise-using-Deep-Residual-Learning

Code of our paper Pixel-wise Estimation of Signal Dependent Image Noise using Deep Residual Learning
Python
14
star
11

Sparse-Coding-based-Image-Super-Resolution-with-CUDA

Code for ICIVC 2017 paper LASSO Approximation and Application to Image Super-resolution with CUDA Acceleration.
Cuda
7
star
12

nccl-osx

Nvidia's NCCL library migrated to Mac OS X (10.13-10.13.6)
C++
3
star
13

MacKernelSDK

macOS kernel SDK targeting various XNU versions (Support both Intel CPU & Apple Silicon)
C
3
star
14

cvxpy

Python
1
star
15

crypten_cifar10_cuda_distributed

A real distributed runnable demonstration of CrypTen image classification on Cifar10 dataset with CUDA enabled.
Python
1
star
16

netcdf2json

Convert netcdf4 ocean current data to json for Null School Earth project.
Python
1
star