From: Yuan Zhao Date: Wed, 19 Dec 2018 16:53:18 +0000 (-0600) Subject: Enable MNIST example on DSP X-Git-Tag: v01.03.00^2~8 X-Git-Url: https://git.ti.com/gitweb?p=tidl%2Ftidl-api.git;a=commitdiff_plain;h=12c78ae2d97e56669b38bfc38bff23c358c63ec2 Enable MNIST example on DSP - It turns out DSP implementation of InnerProduct layer in TIDL library requires input size to be multiple of 8, because it is doing aligned 8-byte loads. - Original LeNet network used in the MNIST example has a second InnerProduct layer of size 500, which is not a multiple of 8. Change the size to 504, re-train the network, re-import into TIDL format. Now the MNIST example works correctly on DSP as well. - MCT-1105 --- diff --git a/examples/mnist/main.cpp b/examples/mnist/main.cpp index d933ccc..75e1283 100644 --- a/examples/mnist/main.cpp +++ b/examples/mnist/main.cpp @@ -95,11 +95,6 @@ int main(int argc, char *argv[]) exit(EXIT_SUCCESS); } assert(opts.num_dsps != 0 || opts.num_eves != 0); - if (opts.num_dsps != 0) - { - cout << "MNIST network not supported on DSP yet." << endl; - exit(EXIT_SUCCESS); - } if (opts.input_file.empty()) { @@ -339,6 +334,7 @@ void DisplayHelp() " different MNIST network. Default is mnist_lenet.\n" "Optional arguments:\n" " -c Valid configs: mnist_lenet\n" + " -d Number of dsp cores to use\n" " -e Number of eve cores to use\n" " -i Path to the MNIST white-on-black images file\n" " -l Path to the MNIST labels file\n" diff --git a/examples/test/testvecs/config/tidl_models/tidl_net_mnist_lenet.bin b/examples/test/testvecs/config/tidl_models/tidl_net_mnist_lenet.bin index ea9ac6c..96a7583 100644 Binary files a/examples/test/testvecs/config/tidl_models/tidl_net_mnist_lenet.bin and b/examples/test/testvecs/config/tidl_models/tidl_net_mnist_lenet.bin differ diff --git a/examples/test/testvecs/config/tidl_models/tidl_param_mnist_lenet.bin b/examples/test/testvecs/config/tidl_models/tidl_param_mnist_lenet.bin index 66cc8a6..54405aa 100644 Binary files a/examples/test/testvecs/config/tidl_models/tidl_param_mnist_lenet.bin and b/examples/test/testvecs/config/tidl_models/tidl_param_mnist_lenet.bin differ