Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/amperecomputingai/aio-examples


https://github.com/amperecomputingai/aio-examples

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

        

# aio-examples

You can try Tensorflow powered by AIO by either running jupyter notebook examples or python scripts on CLI level.

**Note: Before running the examples, please run download_models.sh script to pull down all models.**

## Running Jupyter Notebook QuickStart Examples

Use AIO_NUM_THREADS to specify the number of cores the AIO compute kernels will run on
```
export AIO_NUM_THREADS=16
cd /aio-examples/
bash download_models.sh
bash start_notebook.sh
```

if you would like to run examples using with CLI you can run the start_notebook.sh in the background like so:

```
bash start_notebook.sh &
```

If you run it on a cloud instance, make sure your machine has port 8080 open and on your local device run:
```
ssh -N -L 8080:localhost:8080 -i [email protected]
```

Use a browser to point to the URL printed out by the Jupyter notebook launcher. You will find
Jupyter Notebook examples, examples.ipynb, under /classification and /object_detection folders.
The examples run through several inference models, visualize results and present the performance
numbers.

## Running Examples With CLI
To use CLI-level scripts:

Use AIO_NUM_THREADS to specify the number of cores the AIO compute kernels will run on
```
export AIO_NUM_THREADS=16
cd /aio-examples/
```

Download the models:
```
bash download_models.sh
```

Go to the directory of choice, e.g.
```
cd classification/resnet_50_v15
```
Evaluate the model with run.py script

Optional arguments:

-h, --help show this help message and exit

-m MODEL_PATH, --model_path MODEL_PATH

-p {fp32,fp16,int8}, --precision {fp32,fp16,int8}

-b BATCH_SIZE, --batch_size BATCH_SIZE

```
python run.py -m resnet_50_v15_tf_fp32.pb -p fp32
python run.py -m resnet_50_v15_tflite_int8.tflite -p int8
```