Code Monkey home page Code Monkey logo

pytorch_samples's Introduction

Pytorch Samples

Setup steps

# download and install conda
wget https://repo.anaconda.com/archive/Anaconda3-2019.10-Linux-x86_64.sh -O ~/anaconda3.sh

# for slient mode, please refer to https://docs.anaconda.com/anaconda/install/silent-mode/
bash ./anaconda3.sh

export PATH=$PATH:~/anaconda3/bin
source ~/.bashrc

# create conda env.
conda create -n open-mmlab python=3.7 -y
conda activate open-mmlab

# install pytorch

# CUDA 9.0
conda install pytorch==1.1.0 torchvision==0.3.0 cudatoolkit=9.0
# CUDA 10.0
conda install pytorch==1.2.0 torchvision==0.4.0 cudatoolkit=10.0
# CUDA 10.1
conda install pytorch==1.4.0 torchvision==0.5.0 cudatoolkit=10.1 -c pytorch

# PILLOW 7.0 is not compatible with pytorch 1.3.*, downgrade to 6.1
# ImportError: cannot import name 'PILLOW_VERSION' from 'PIL' 
conda install pillow=6.1

# install git and clone this repo
conda install git
git clone https://github.com/loveunk/pytorch_samples.git

# run the MNIST training and test sample
cd pytorch_samples/mnist/
python main.py

Verify PyTorch GPU

import torch

# Expect `True`
print(torch.cuda.is_available())
print(torch.cuda.current_device())
print(torch.version.cuda)

TensorFlow Samples

pytorch_samples's People

Contributors

loveunk avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.