MIVisionX DGtest is a tutorial program for those who are new to MIOpen & OpenVX. It runs inference on the MNIST dataset using MIOpen & OpenVX.
The program is divided into four parts:
annmodule is created by the AMD model compiler. You can convert your own trained caffemodel to openvx graph using the model-compiler. See the below section for the detailed instruction. Once the conversion is done, the corresponding c++ codes will be generated including annmodule which contains the information about your pre-trained caffemodel.
Userinterface class is for the gui functionality of the DGtest. It has the palette and the result window to draw the image and show the result output.
DGtest class is where you actually run the inference. Using annAddToGraph() function in annmodule, it adds weights, input tensor, and output tensor to the graph. If it was successful, it preprocess the image and process the graph (runs the inference) using vxProcessGraph() function.
See the OpenVX documentation for detailed explanation about OpenVX API calls.
Build using Cmake on Linux (Ubuntu 16.04 64bit)
mkdir build cd build cmake .. make
Usage: ./DGtest [weights.bin]\n" [weights.bin] The name of the weights file to be used for the inference. It is created by running caffemodel converter. See the belows section for using your own caffemodel.
Testing with your own Caffemodel
You can test your own trained MNIST caffemodel using the model compiler
1. Convert your caffemodel->NNIR->openvx using the model compiler. 2. From the generated files, copy annmodule.cpp annmodule.h weights.bin to the DGtest folder. 3. Build the program again. make