Skip to content

Commit

Permalink
Merge branch 'master' into kernel_bug_fixv2
Browse files Browse the repository at this point in the history
  • Loading branch information
lerenhua authored Aug 25, 2023
2 parents 6c1170b + f5b79ef commit aa0963b
Show file tree
Hide file tree
Showing 76 changed files with 2,320 additions and 1,323 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/jupyter-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# on:
# push:
# tags:
# - '*'

# jobs:
# test:
# name: test-notebook-${{matrix.config.name}}
# runs-on: ${{matrix.config.os}}
# strategy:
# matrix:
# config:
# - {name: x86_64-macos, os: macos-latest}
# - {name: x86_64-linux, os: ubuntu-latest}
# - {name: x86_64-windows, os: windows-latest}

# steps:
# - uses: actions/checkout@v2

# - name: Setup Python
# uses: actions/setup-python@v2
# with:
# python-version: 3.7

# - name: Install dependencies
# run: pip install --upgrade pip && pip install jupyterlab pytest nbmake

# - name: Run tests
# run: pytest --nbmake examples/user_guide
# env:
# PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION: python
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,47 +15,55 @@
Telegram: [nncase community](https://t.me/joinchat/PPcEPZMLaTViNDI1)

## Install from binaries

## 从二进制安装

Download prebuilt binaries from [Release](https://github.com/kendryte/nncase/releases).

下载预编译的二进制文件 [Release](https://github.com/kendryte/nncase/releases)

## Build from source

## 从源码编译

[Build from source](./docs/build.md)

## Supported operators

## 支持的算子

- [TFLite ops](./docs/tflite_ops.md)
- [Caffe ops](./docs/caffe_ops.md)
- [ONNX ops](./docs/onnx_ops.md)


## K210/K510

- [Usage](https://github.com/kendryte/nncase/blob/release/1.0/docs/USAGE_EN.md)
- [FAQ](https://github.com/kendryte/nncase/blob/release/1.0/docs/FAQ_EN.md)
- [使用说明](https://github.com/kendryte/nncase/blob/release/1.0/docs/USAGE_ZH.md)
- [常见问题](https://github.com/kendryte/nncase/blob/release/1.0/docs/FAQ_ZH.md)
- [Example](https://github.com/kendryte/nncase/blob/release/1.0/examples/user_guide/)

## K230

- [Usage](./docs/USAGE_v2_EN.md)
- [FAQ](./docs/FAQ_EN.md)
- [Example](./examples/user_guide/k230_simulate-EN.ipynb)
- [使用说明](./docs/USAGE_v2.md)
- [常见问题](./docs/FAQ_ZH.md)
- [Example](./examples/user_guide/)
- [示例](./examples/user_guide/k230_simulate-ZH.ipynb)

## Resources
## 资源

## 资源
### K210
- [K210_Yolo_framework](https://github.com/zhen8838/K210_Yolo_framework)
- [Shts! 's Blog (Japanese)](https://www.shtsno24.tokyo/2020/03/nncase-v020.html)
- [Shts!'s Blog (Japanese)](https://www.shtsno24.tokyo/2020/03/nncase-v020.html)

---

## Architecture

## 架构

<div align="center">
Expand Down
20 changes: 10 additions & 10 deletions docs/FAQ_EN.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
# FAQ

[TOC]
[toc]

## 1. Error installing `whl` package

### 1.1 Q: `xxx.whl is not a supported wheel on this platform`

A: Upgrade pip >= 20.3 using `pip install --upgrade pip`



----
---

## 2. Compile-time errors

### 2.1 "System.NotSupportedException"

#### 2.1.1 Q: Compile model reported error "System.NotSupportedException: Not Supported *** op: XXX"

A: This exception indicates that there are operators, `XXX`, that are not yet supported. You can create a issue in [nncase Github Issue](https://github.com/kendryte/nncase/issues). In the current directory `***_ops.md`, you can view the operators already supported in each inference framework.
A: This exception indicates that there are operators, `XXX`, that are not yet supported. You can create a issue in [nncase Github Issue](https://github.com/kendryte/nncase/issues). In the current directory `***_ops.md`, you can view the operators already supported in each inference framework.

If 'XXX' belongs to quantization-related operators such as `FAKE_QUANT`, `DEQUANTIZE`, `QUANTIZE`, it indicates that the current model is a quantized model, and 'nncase' does not currently support such models, please compile `kmodel` using a floating point model.

Expand All @@ -28,15 +26,19 @@ If 'XXX' belongs to quantization-related operators such as `FAKE_QUANT`, `DEQUAN

A: Use `sudo gedit /proc/sys/fs/inotify/max_user_instances` to change 128 to a larger value.

### 2.3 `initialize` error

#### 2.3.1 Q:"RuntimeError: Failed to initialize hostfxr" appears when compiling the kmodel.

A1:Need to install dotnet-7.0.

----
---

## 3. Runtime errors

### 3.1 Q: Compiling `kmodel` is fine, but when inferring, the error `nncase.simulator.k230.sc: not found`occurs.

A: You need to check whether the versions of `nncase` and `nncase-kpu` are the same.
A: First, make sure that the path of the nncase installation is added to the PATH environment variable. You need to check whether the versions of `nncase` and `nncase-kpu` are the same.

```shell
root@a52f1cacf581:/mnt# pip list | grep nncase
Expand All @@ -46,9 +48,7 @@ nncase-kpu 2.1.1.20230721

If inconsistent, install the same version of the Python package `pip install nncase==x.x.x.x nncase-kpu==x.x.x.x`



----
---

## 4. Runtime error on k230 development board

Expand Down
24 changes: 11 additions & 13 deletions docs/FAQ_ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,35 @@

A:升级 pip >= 20.3 `pip install --upgrade pip`



----
---

## 2.编译模型时报错

### 2.1 `System.NotSupportedException`

#### 2.1.1 Q:编译模型报错“System.NotSupportedException: Not Supported *** op: XXX”。

A:该异常表明`XXX`算子尚未支持,可以在[nncase Github Issue](https://github.com/kendryte/nncase/issues)中提需求。当前目录下 `***_ops.md`文档,可以查看各个推理框架中已经支持的算子。
A:该异常表明 `XXX`算子尚未支持,可以在[nncase Github Issue](https://github.com/kendryte/nncase/issues)中提需求。当前目录下 `***_ops.md`文档,可以查看各个推理框架中已经支持的算子。

如果`XXX`属于 `FAKE_QUANT``DEQUANTIZE``QUANTIZE`等量化相关的算子,表明当前模型属于量化模型,`nncase`目前不支持这类模型,请使用浮点模型来编译`kmodel`
如果 `XXX`属于 `FAKE_QUANT``DEQUANTIZE``QUANTIZE`等量化相关的算子,表明当前模型属于量化模型,`nncase`目前不支持这类模型,请使用浮点模型来编译 `kmodel`

### 2.2 `System.IO.IOException`

#### 2.2.1 Q:下载`nncase`仓库自己编译后,运行test出现这个错误"The configured user limit (128) on the number of inotify instances has been reached, or the per-process limit on the number of open file descriptors has been reached"。
#### 2.2.1 Q:下载 `nncase`仓库自己编译后,运行test出现这个错误"The configured user limit (128) on the number of inotify instances has been reached, or the per-process limit on the number of open file descriptors has been reached"。

A1:使用 `sudo gedit /proc/sys/fs/inotify/max_user_instances`修改128为更大的值即可。

### 2.3 `initialize`相关
#### 2.3.1 Q:编译模型出现如下错误`RuntimeError: Failed to initialize hostfxr`
A1:需要安装dotnet-7.0


----
---

## 3. 推理时报错

### 3.1 Q:在编译kmodel正常, 但是推理的时候出现`nncase.simulator.k230.sc: not found`的错误。
### 3.1 Q:在编译kmodel正常, 但是推理的时候出现 `nncase.simulator.k230.sc: not found`的错误。

A:需要检查`nncase``nncase-kpu`的版本是否一致
A:将nncase的安装路径加入到 `PATH`环境变量中,同时检查一下nncase和nncase-kpu版本是否一致

```shell
root@a52f1cacf581:/mnt# pip list | grep nncase
Expand All @@ -44,9 +44,7 @@ nncase-kpu 2.1.1.20230721

如果不一致,请安装相同版本的Python包 `pip install nncase==x.x.x.x nncase-kpu==x.x.x.x`



----
---

## 4. k230开发板推理时报错

Expand Down
437 changes: 437 additions & 0 deletions examples/user_guide/k230_simulate-EN.ipynb

Large diffs are not rendered by default.

438 changes: 438 additions & 0 deletions examples/user_guide/k230_simulate-ZH.ipynb

Large diffs are not rendered by default.

Loading

0 comments on commit aa0963b

Please sign in to comment.