README.md 1.03 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Resnet50 inference with MIGraphX and Onnxruntime

## Description

This example demonstrates how to perform an MIGraphX Python API inference through onnxruntime. The model used here is from Torchvision's pretrained resnet50 model

## Content
- [Basic Setup](#Basic-Setup)
- [**Running this Example**](#Running-this-Example)

## Basic Setup
Before running inference we must first install MIGraphX via the Docker method as it also downloads onnxruntime into the dockerfile created.

## Running this Example

This directory contains everything needed to perform an inference once MIGraphX has been installed in the docker contaienr

```
$ mkdir build
$ cd build
$ CXX=/opt/rocm/llvm/bin/clang++ cmake ..
$ make -j$(nproc) package
$ dpkg -i *.deb
```
Once you've build and installed MIGraphX as a deb package go to the examples folder, run the pre-req script to build and install
onnxruntime and then install the approrpaite version of pytorch

```
$ cd examples/onnxruntime/resnet50
$ ./prereq_steps.sh
$ pip list | grep onnxruntime
$ python resnet50.py
```