Skip to content

DataScientificallYours/pytorch

 
 

Repository files navigation


PyTorch is a Python package that provides two high-level features:

Prerequisites

Instantiate a GPU on GCE Nvidia enabled VM

For the previous step we will need a GCP account. It’s free.

Open in Cloud Shell

$ wget https://raw.githubusercontent.com/makramjandar/AwesomeScripts/master/gcs/gcp_vm_instantiation.sh && bash gcp_vm_instantiation.sh

Once the VM has been deployed, we can login into it from Google Cloud Shell: $ gcloud compute --project $PROJECT_ID ssh --zone $ZONE $MACHINE_NAME

Install Nvidia Driver

$ wget -O - -q "https://raw.githubusercontent.com/makramjandar/AwesomeScripts/master/bash/install-nvidia.sh" | bash

Install Anaconda

When building anything, it’s safer to do it in a conda environment lest you mess up and pollute your system environment. $ wget -O - -q 'https://raw.githubusercontent.com/makramjandar/AwesomeScripts/master/bash/install-anaconda.sh' | bash

Build From Source

With Cuda

$ wget https://raw.githubusercontent.com/makramjandar/AwesomeScripts/master/bash/build-pytorch.sh && bash build-pytorch.sh cuda

CPU Only

$ wget https://raw.githubusercontent.com/makramjandar/AwesomeScripts/master/bash/build-pytorch.sh && bash build-pytorch.sh

Verify your installation

Still under the pytorch-build environment, let’s run some examples to make sure your installation is correct.

Build the torchvision library from source.

cd ~ && git https://github.com/pytorch/vision.git && python ~/setup.py install

Install tqdm (a dependency for downloading torchvision datasets) with pip in order to run the MNIST example.

pip install tqdm

Now download the examples and run MNIST:

cd ~ && git clone https://github.com/pytorch/examples.git && /examples/mnist/python/main.py

Voilà!!!

License

PyTorch is BSD-style licensed, as found in the LICENSE file.

About

Tensors and Dynamic neural networks in Python with strong GPU acceleration

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 50.9%
  • Python 33.4%
  • Cuda 9.2%
  • C 2.9%
  • CMake 1.8%
  • Objective-C++ 0.7%
  • Other 1.1%