Giter Club home page Giter Club logo

siliconlabs / mltk Goto Github PK

View Code? Open in Web Editor NEW
47.0 13.0 6.0 176.7 MB

A Python package with command-line utilities and scripts to aid the development of machine learning models for Silicon Lab's embedded platforms

Home Page: https://siliconlabs.github.io/mltk/

License: Other

CMake 1.79% Python 25.84% C++ 9.78% C 40.20% Shell 0.01% Jupyter Notebook 21.65% CSS 0.06% HTML 0.07% JavaScript 0.60%
aiot cpp embedded embedded-c embedded-systems internet-of-things iot keras keras-tensorflow machine-learning

mltk's Introduction

Silicon Labs Machine Learning Toolkit (MLTK)

This package is considered EXPERIMENTAL - SILICON LABS DOES NOT OFFER ANY WARRANTIES AND DISCLAIMS ALL IMPLIED WARRANTIES CONCERNING THIS SOFTWARE. 
This package is made available as a self-serve reference supported only by the on-line documentation, and community support. 
There are no Silicon Labs support services for this software at this time.

version PyPI - Python Version gsdk tflm tf

This is a Python package with command-line utilities and scripts to aid the development of machine learning models for Silicon Lab's embedded platforms.

The features of this Python package include:

Refer to Why MLTK? for more details on the benefits of using the MLTK.

Just want to quickly profile a model to see how fast it can run on an embedded target?  
See the [Model Profiler Utility](./docs/guides/model_profiler_utility.md)

Overview

.. raw:: html

   <iframe src="./_static/overview/index.html" height="100%" width="100%" frameborder="0" class="slideshow-iframe" allowfullscreen></iframe>

Installation

Install the pre-built Python package:

.. tab-set::

   .. tab-item:: Windows

      .. code-block:: shell

         pip  install silabs-mltk

   .. tab-item:: Linux

      .. code-block:: shell

         pip3 install silabs-mltk

Or, build and install the Python package from Github:

.. tab-set::

   .. tab-item:: Windows

      .. code-block:: shell

         pip  install git+https://github.com/siliconlabs/mltk.git

   .. tab-item:: Linux

      .. code-block:: shell

         pip3 install git+https://github.com/siliconlabs/mltk.git

Refer to the Installation Guide for more details on how to install the MLTK.

Other Information

License

SPDX-License-Identifier: Zlib

The licensor of this software is Silicon Laboratories Inc.

This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.

Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.

mltk's People

Contributors

silabsbot avatar web-flow avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mltk's Issues

How is energy consumption is calculated?

Hello, I use MLTK library for profiling my tflite model and so far it has been really useful for me. I was wondering about the calculation of energy per inference metric.
In the documentation (https://siliconlabs.github.io/mltk/docs/guides/model_profiler.html), it says that,
"Estimates required energy per inference
NOTE: Estimates are provided based on the ARM Cortex-M33."

I understand that estimations are based on Cortex-M33, but it is not clear to me how is it calculated.
Is there any specific formula for the calculation?

openvino to tflite conversion issue for a yolov7 based onnx model

Hi,

I am facing below error while doing this conversion for y yolov7-w6 based model file-

`raise e.with_traceback(filtered_tb) from None
ValueError: Exception encountered when calling layer "tf.concat_6" (type TFOpLambda).

Dimension 1 in both shapes must be equal, but are 48 and 52. Shapes are [1,48,18] and [1,52,22]. for '{{node tf.concat_6/concat}} = ConcatV2[N=4, T=DT_FLOAT, Tidx=DT_INT32](Placeholder, Placeholder_1, Placeholder_2, Placeholder_3, tf.concat_6/concat/axis)' with input shapes: [1,40,10,512], [1,44,14,512], [1,48,18,512], [1,52,22,512], [] and with computed input tensors: input[4] = <-1>.

Call arguments received by layer "tf.concat_6" (type TFOpLambda):
• values=['tf.Tensor(shape=(1, 40, 10, 512), dtype=float32)', 'tf.Tensor(shape=(1, 44, 14, 512), dtype=float32)', 'tf.Tensor(shape=(1, 48, 18, 512), dtype=float32)', 'tf.Tensor(shape=(1, 52, 22, 512), dtype=float32)']
• axis=-1
• name=concat`

Please help to resolve this issue.

Out-of-date URLs to github commits of profiler binaries in mltk_assets

The URLs pointing to the .zip files are out-of-date in the below YAML
mltk\utils\firmware_apps\download_urls.yaml

To reproduce the error
mltk profile keyword_spotting.mltk.zip --estimates --full-summary --device

Error Log:

Time: 2023-08-24 12:09:49
Command-line: profile keyword_spotting.mltk.zip --estimates --full-summary --device
Python version:  3.10.0 (tags/v3.10.0:b494f59, Oct  4 2021, 19:00:18) [MSC v.1929 64 bit (AMD64)]
Python path: D:\ws\mltk\.venv\Scripts\python.exe
Platform: Windows-10-10.0.22621-SP0
MLTK version: 0.18.0
MLTK repo hash: fa2876e1237519e9304407ea4424a88be5e288aa
Extracting keyword_spotting.tflite -> C:/Users/shari/AppData/Local/Temp/shari/mltk/models/keyword_spotting/extracted_files
Up-to-date: https://github.com/SiliconLabs/mltk_assets/raw/master/tools/commander/Commander_win32_x64_1v12p0b1057.zip -> C:/Users/shari/.mltk/tools/commander/v1.12
Programming ML model to device ...
Downloading https://github.com/SiliconLabs/mltk_assets/raw/master/applications/mltk_model_profiler/mltk_model_profiler-brd2601-none-0da859ec.zip
to C:/Users/shari/.mltk/downloads/mltk_model_profiler-brd2601-none-0da859ec.zip
(This may take awhile, please be patient ...)
Failed to profile model
Traceback (most recent call last):
  File "d:\ws\mltk\mltk\cli\profile_mltk_cli.py", line 114, in profile_model_command
    profiling_report = profile_model(
  File "d:\ws\mltk\mltk\core\profile_model.py", line 77, in profile_model
    profiling_model_results = profile_model_on_device(
  File "d:\ws\mltk\mltk\core\profile_model.py", line 210, in profile_model_on_device
    firmware_apps.program_image_with_model(
  File "d:\ws\mltk\mltk\utils\firmware_apps\__init__.py", line 122, in program_image_with_model
    firmware_image_path = get_image(
  File "d:\ws\mltk\mltk\utils\firmware_apps\__init__.py", line 92, in get_image
    download_dir = download_verify_extract(
  File "d:\ws\mltk\mltk\utils\archive_downloader.py", line 129, in download_verify_extract
    download_url(
  File "d:\ws\mltk\mltk\utils\archive_downloader.py", line 331, in download_url
    tmp_filepath, _ = urllib.request.urlretrieve(url, tmp_filepath, t.update_chunk)
  File "C:\Users\shari\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 241, in urlretrieve
    with contextlib.closing(urlopen(url, data)) as fp:
  File "C:\Users\shari\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
  File "C:\Users\shari\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 525, in open
    response = meth(req, response)
  File "C:\Users\shari\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 634, in http_response
    response = self.parent.error(
  File "C:\Users\shari\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 563, in error
    return self._call_chain(*args)
  File "C:\Users\shari\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 496, in _call_chain
    result = func(*args)
  File "C:\Users\shari\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 643, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found
Failed to profile model, err: Failed to download: https://github.com/SiliconLabs/mltk_assets/raw/master/applications/mltk_model_profiler/mltk_model_profiler-brd2601-none-0da859ec.zip

[BUG] mltk.core.view_model.py has an install inside

Hi, thanks for putting this library together. I noticed the file view_model.py attempts to install a package.

install_pip_package('netron')

I would expect the library dependencies to be filled when installing the mltk package not to occur during the library runtime.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.