Resources for using ONNX Runtime AI on Jetson Embedded Devices in Education

Published 03-11-2021 12:33 PM 583 Views
Microsoft

In addition to my role as a Principal Cloud Advocate and Lead for IoT Advocacy at Microsoft, I act as a professor at the University of Houston where I teach a course focused on Cloud-Powered App Development. As part of this course, we focus on AI @ the Edge Scenarios backed by Microsoft Azure IoT Services.  To teach this concepts, we have chosen to target the very afforodable ($60 USD) NVIDIA Jetson Nano DevKit.  This experience is catalogued in-depth in a previous article on the Microsoft Educator Developer Blog

pdecarlo_0-1615493364797.jpeg


We find that student's most requested point of customization for AI @ Edge solutions is in the customization of the AI models themselves.  This can pose issues as there are various formats out there for developing computer vision based models, including: PyTorch, MXNet, Caffe, and Tensorflow.  Oftentimes, the tooling to develop these formats results in vendor lock-in, meaning that future applications of your model may be bound by limitations depending on tooling and runtime compatibility for building and executing the model in question.  

The Open Neural Network Exchange Format (ONNX) is a model standard/ format for exchanging deep learning models across platforms.  It's ability to be portable across model formats and even computer architectures makes it a prime candidate for AI model development without limitations.  It can even adapt to the presence of say GPU acceleration on a given computational platform to offer enhancement of your model at runtime, without any need to redevelop your model to take advantage of those optimizations.  Simply put, if you start with ONNX you can go anywhere and optimize without any extra effort.


Combining this fact with our target NVIDIA Jetson hardware, we can develop course content rooted in the development of ONNX based AI models to provide an open platform for students to build and experiment on, with the added benefit of GPU accelerated inference on low-cost embedded hardware.  This allows the students to apply concepts on a device that they can physically alter with the addition of cameras, microphones, or other sensors to aid in their solutioning.

onnx.png

As a basis for formal understanding of how ONNX works with NVIDIA GPUs, we recommend starting with Manash Goswami's presentation on the topic at the recent NVIDIA GTC 2020 conference (Note: that viewing this resource will require completing a free registration to NVIDIA's Developer Program Membership). 

After you have familiarized with the fundamentals, we recommend the following resources as hands-on lab or supplemental material for applying the concepts to run ONNX models on NVIDIA Jetson hardware for development of AI @ Edge solutions:

 

With these resources, we hope that you can employ the teaching of AI @ Edge scenarios without the fear of encountering the limitations inherent in less adaptable model formats.  ONNX based model development can ensure that your models are portable across architectures and adaptable to the existence of accelerators on compatible hardware.  For more information on the ONNX model format, be sure to check out https://www.onnxruntime.ai/ and for details on how to acquire NVIDIA Jetson embedded devices, check out this link.

Until next time,

Paul

%3CLINGO-SUB%20id%3D%22lingo-sub-2203255%22%20slang%3D%22en-US%22%3EResources%20for%20using%20ONNX%20Runtime%20AI%20on%20Jetson%20Embedded%20Devices%20in%20Education%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2203255%22%20slang%3D%22en-US%22%3E%3CP%3EIn%20addition%20to%20my%20role%20as%20a%20%3CA%20href%3D%22https%3A%2F%2Fwww.linkedin.com%2Fin%2Fpjdecarlo%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3EPrincipal%20Cloud%20Advocate%20and%20Lead%20for%20IoT%20Advocacy%20at%20Microsoft%3C%2FA%3E%2C%20I%20%3CA%20href%3D%22https%3A%2F%2Fwww.ratemyprofessors.com%2FShowRatings.jsp%3Ftid%3D1903236%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Eact%20as%20a%20professor%20at%20the%20University%20of%20Houston%3C%2FA%3E%20where%20I%20teach%20a%20course%20focused%20on%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Ftoolboc%2FCloud-Powered-App-Development-Curriculum%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ECloud-Powered%20App%20Development%3C%2FA%3E.%26nbsp%3BAs%20part%20of%20this%20course%2C%20we%20focus%20on%20AI%20%40%20the%20Edge%20Scenarios%20backed%20by%20%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fen-us%2Ffree%2Fiot%2F%3FWT.mc_id%3Diot-20354-pdecarlo%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EMicrosoft%20Azure%20IoT%20Services%3C%2FA%3E.%26nbsp%3B%20To%20teach%20this%20concepts%2C%20we%20have%20chosen%20to%20target%20the%20very%20afforodable%20(%2460%20USD)%20%3CA%20href%3D%22https%3A%2F%2Famzn.to%2F3l6usaV%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3ENVIDIA%20Jetson%20Nano%20DevKit%3C%2FA%3E.%26nbsp%3B%20This%20experience%20is%20catalogued%20in-depth%20in%20a%20previous%20article%20on%20the%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Feducator-developer-blog%2Fhow-to-teach-cloud-powered-app-development-virtually%2Fba-p%2F2062195%3FWT.mc_id%3Diot-12597-pdecarlo%22%20target%3D%22_blank%22%3EMicrosoft%20Educator%20Developer%20Blog%3C%2FA%3E.%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CCENTER%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22pdecarlo_0-1615493364797.jpeg%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F262890iD91F0474888582F6%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22pdecarlo_0-1615493364797.jpeg%22%20alt%3D%22pdecarlo_0-1615493364797.jpeg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FCENTER%3E%0A%3CP%3E%3CBR%20%2F%3EWe%20find%20that%20student's%20most%20requested%20point%20of%20customization%20for%20AI%26nbsp%3B%40%20Edge%20solutions%20is%20in%20the%20customization%20of%20the%20AI%20models%20themselves.%26nbsp%3B%20This%20can%20pose%20issues%20as%20there%20are%20various%20formats%20out%20there%20for%20developing%20computer%20vision%20based%20models%2C%20including%3A%20%3CA%20href%3D%22https%3A%2F%2Fpytorch.org%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3EPyTorch%3C%2FA%3E%2C%20%3CA%20href%3D%22https%3A%2F%2Fmxnet.apache.org%2Fversions%2F1.7.0%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3EMXNet%3C%2FA%3E%2C%20%3CA%20href%3D%22https%3A%2F%2Fcaffe.berkeleyvision.org%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3ECaffe%3C%2FA%3E%2C%20and%20%3CA%20href%3D%22https%3A%2F%2Fwww.tensorflow.org%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3ETensorflow%3C%2FA%3E.%26nbsp%3B%20Oftentimes%2C%20the%20tooling%20to%20develop%20these%20formats%20results%20in%20vendor%20lock-in%2C%20meaning%20that%20future%20applications%20of%20your%20model%20may%20be%20bound%20by%20limitations%20depending%20on%20tooling%20and%20runtime%20compatibility%20for%20building%20and%20executing%20the%20model%20in%20question.%26nbsp%3B%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3EThe%20%3CA%20href%3D%22https%3A%2F%2Fwww.onnxruntime.ai%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3EOpen%20Neural%20Network%20Exchange%20Format%20(ONNX)%3C%2FA%3E%20is%20a%20model%20standard%2F%20format%20for%20exchanging%20deep%20learning%20models%20across%20platforms.%26nbsp%3B%20It's%20ability%20to%20be%20portable%20across%20model%20formats%20and%20even%20computer%20architectures%20makes%20it%20a%20prime%20candidate%20for%20AI%20model%20development%20without%20limitations.%26nbsp%3B%20It%20can%20even%20adapt%20to%20the%20presence%20of%20say%20GPU%20acceleration%20on%20a%20given%20computational%20platform%20to%20offer%20enhancement%20of%20your%20model%20at%20runtime%2C%20without%20any%20need%20to%20redevelop%20your%20model%20to%20take%20advantage%20of%20those%20optimizations.%26nbsp%3B%20Simply%20put%2C%20if%20you%20start%20with%20ONNX%20you%20can%20go%20anywhere%20and%20optimize%20without%20any%20extra%20effort.%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%3CBR%20%2F%3ECombining%20this%20fact%20with%20our%20target%20NVIDIA%20Jetson%20hardware%2C%20we%20can%20develop%20course%20content%20rooted%20in%20the%20development%20of%20ONNX%20based%20AI%20models%20to%20provide%20an%20open%20platform%20for%20students%20to%20build%20and%20experiment%20on%2C%20with%20the%20added%20benefit%20of%20GPU%20accelerated%20inference%20on%20low-cost%20embedded%20hardware.%26nbsp%3B%20This%20allows%20the%20students%20to%20apply%20concepts%20on%20a%20device%20that%20they%20can%20physically%20alter%20with%20the%20addition%20of%20cameras%2C%20microphones%2C%20or%20other%20sensors%20to%20aid%20in%20their%20solutioning.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CCENTER%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22onnx.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F262887i36D72FC7D7348E93%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22onnx.png%22%20alt%3D%22onnx.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FCENTER%3E%0A%3CP%3EAs%20a%20basis%20for%20formal%20understanding%20of%20how%20ONNX%20works%20with%20NVIDIA%20GPUs%2C%20we%20recommend%20starting%20with%20%3CA%20style%3D%22background-color%3A%20%23ffffff%3B%22%20href%3D%22https%3A%2F%2Fresources.nvidia.com%2Fevents%2FGTC2020s21379%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3EManash%20Goswami's%20presentation%20on%20the%20topic%20at%20the%20recent%20NVIDIA%20GTC%202020%20conference%3C%2FA%3E%26nbsp%3B(Note%3A%20that%20viewing%20this%20resource%20will%20require%20completing%20a%20free%20registration%20to%20NVIDIA's%20Developer%20Program%20Membership).%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EAfter%20you%20have%20familiarized%20with%20the%20fundamentals%2C%20we%20recommend%20the%20following%20resources%20as%20hands-on%20lab%20or%20supplemental%20material%20for%20applying%20the%20concepts%20to%20run%20ONNX%20models%20on%20NVIDIA%20Jetson%20hardware%20for%20development%20of%20AI%20%40%20Edge%20solutions%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdeveloper.nvidia.com%2Fblog%2Fannouncing-onnx-runtime-for-jetson%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3EAnnouncing%20ONNX%20Runtime%20Availability%20in%20the%20NVIDIA%20Jetson%20Zoo%20for%20High%20Performance%20Inferencing%3C%2FA%3E%26nbsp%3B-%20NVIDIA%20Developer%20Blog%26nbsp%3B%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure-Samples%2Fonnxruntime-iot-edge%2Fblob%2Fmaster%2FREADME-ONNXRUNTIME-arm64.md%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EIntegrate%20Azure%20with%20machine%20learning%20execution%20on%20the%20NVIDIA%20Jetson%20platform%3C%2FA%3E%26nbsp%3B-%20L%3CSPAN%3Eearn%20how%20to%20integrate%20Azure%20services%20with%20machine%20learning%20on%20the%20NVIDIA%20Jetson%20device%20using%20Python%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Ftoolboc%2FIntelligent-Video-Analytics-with-NVIDIA-Jetson-and-Microsoft-Azure%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EIntelligent-Video-Analytics-with-NVIDIA-Jetson-and-Microsoft-Azure%3C%2FA%3E%26nbsp%3B-%26nbsp%3B%3CSPAN%3EA%20repository%20demonstrating%20an%20end-to-end%20architecture%20for%20Intelligent%20Video%20Analytics%20using%20NVIDIA%20hardware%20with%20Microsoft%20Azure%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Febertrams%2Fiotedge-iva-nano%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EAzure%20IoT%20Edge%20Workshop%3A%20Visual%20Anomaly%20Detection%20over%20multiple%20cameras%20with%20NVIDIA%20Jetson%20Nano%3C%2FA%3E%26nbsp%3B-%26nbsp%3B%3CSPAN%3EIn%20this%20workshop%2C%20you'll%20discover%20how%20to%20build%20a%20solution%20that%20can%20process%20several%20real-time%20video%20streams%20with%20an%20AI%20model%20on%20an%20NVIDIA%20Jetson%20Nano%20device%2C%20how%20to%20build%20your%20own%20AI%20model%20to%20detect%20custom%20anomalies%20and%20finally%20how%20to%20operate%20it%20remotely.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EWith%20these%20resources%2C%20we%20hope%20that%20you%20can%20employ%20the%20teaching%20of%20AI%26nbsp%3B%40%20Edge%20scenarios%20without%20the%20fear%20of%20encountering%20the%20limitations%20inherent%20in%20less%20adaptable%20model%20formats.%26nbsp%3B%20ONNX%20based%20model%20development%20can%20ensure%20that%20your%20models%20are%20portable%20across%20architectures%20and%20adaptable%20to%20the%20existence%20of%20accelerators%20on%20compatible%20hardware.%26nbsp%3B%20For%20more%20information%20on%20the%20ONNX%20model%20format%2C%20be%20sure%20to%20check%20out%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fwww.onnxruntime.ai%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fwww.onnxruntime.ai%2F%3C%2FA%3E%26nbsp%3Band%20for%20details%20on%20how%20to%20acquire%20NVIDIA%20Jetson%20embedded%20devices%2C%20check%20out%20this%20%3CA%20href%3D%22https%3A%2F%2Fdeveloper.nvidia.com%2Fbuy-jetson%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Elink%3C%2FA%3E.%3CBR%20%2F%3E%3CBR%20%2F%3EUntil%20next%20time%2C%3CBR%20%2F%3E%3CBR%20%2F%3EPaul%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-2203255%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3E%3CBR%20%2F%3EThe%20combination%20of%20NVIDIA%20Jetson%20Hardware%20with%26nbsp%3BONNX%20is%20a%20prime%20candidate%20for%20AI%20model%20development%20without%20limitations.%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22onnx.png%22%20style%3D%22width%3A%20370px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F262877i063D09515BAF0173%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22onnx.png%22%20alt%3D%22onnx.png%22%20%2F%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-TEASER%3E
Co-Authors
Version history
Last update:
‎Mar 11 2021 12:30 PM
Updated by: