Git Product home page Git Product logo

lazy-tensor-samples's Introduction

lazy-tensor-samples

Table of Contents

Table of contents generated with markdown-toc

How to Run Examples

Install Torchvision and Lazy Tensor Core

Install torchvision:

python -m pip install torchvision
python -m pip uninstall torch # if it was automatically installed by torchvision

Install the lazy-tensor-core Python package by following their instructions.

Update PYTHONPATH:

export PYTHONPATH=/path/to/pytorch/lazy_tensor_core:$PYTHONPATH

Bert

Setup

First install Lazy Tensor Core.

Install the following Python packages:

python -m pip transformers datasets

Running Example

From inside the lazy-tensor-samples directory, run:

python lazytensor_bert_example.py

The output of this example can be found in lazytensor_bert_example_output.txt.

MaskRCNN

Setup

First install Torchvision and Lazy Tensor Core.

Install the maskrcnn-benchmark using my fork, which includes some changes to make the benchmark run on LTC:

git clone https://github.com/ramiro050/maskrcnn-benchmark.git
cd maskrcnn-benchmark
git checkout lazy-tensor-maskrcnn

Follow the maskrcnn-benchmark installation instructions.

Update PYTHONPATH:

export PYTHONPATH=/path/to/maskrcnn-benchmark/demo:$PYTHONPATH

Running Example

From inside the lazy-tensor-samples directory, run:

python lazytensor_maskrcnn_example.py path/to/image.png path/to/maskrcnn-benchmark

where img.png is the image to run the model on.

The output of this example can be found in lazytensor_maskrcnn_example_output.txt.

Resnet-18 Inference and Training

Setup

First install Torchvision and Lazy Tensor Core.

Additional steps for Inference

Install the following Python packages:

python -m pip install pillow request

Additional steps for Training

Install the library libsndfile. On Ubuntu, simply run

sudo apt-get install libsndfile-dev

Install the PyTorch benchmarks using my fork, which includes some changes to make the benchmark run on LTC (the changes are based on this patch by @alanwaketan):

git clone https://github.com/ramiro050/benchmark.git
cd benchmark
git checkout lazytensor_support

Then follow these instructions to install the benchmark.

Running Inference Example

From inside the lazy-tensor-samples directory, run:

python lazytensor_resnet18_example.py

The output of this example can be found in lazytensor_resnet18_example_output.txt.

Running Training Example

From inside the benchmark directory, run:

python run.py resnet18 -d lazy -t train

lazy-tensor-samples's People

Contributors

ramiro050 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.