This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
products:sbc:vim4:npu:demos:vgg16 [2023/09/18 00:37] sravan [Build virtual environment] |
products:sbc:vim4:npu:demos:vgg16 [2025/06/11 21:50] (current) louis |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ~~tag> | ~~tag> | ||
| - | ====== VGG16 Tensorflow | + | **Doc for version ddk-3.4.7.7** |
| + | |||
| + | ====== VGG16 TensorFlow | ||
| {{indexmenu_n> | {{indexmenu_n> | ||
| + | |||
| + | ===== Introduction ===== | ||
| + | |||
| + | VGG16 is a classification model. It can assign a single label to an entire image. | ||
| + | |||
| + | Image and inference results on VIM4. | ||
| + | |||
| + | {{: | ||
| + | |||
| + | {{: | ||
| [[https:// | [[https:// | ||
| Line 22: | Line 34: | ||
| Follow Docker official documentation to install Docker: [[https:// | Follow Docker official documentation to install Docker: [[https:// | ||
| - | Then fetch the prebuilt NPU Docker | + | Follow |
| ```shell | ```shell | ||
| - | $ docker pull yanwyb/npu:v1 | + | docker pull numbqq/npu-vim4 |
| - | $ docker run -it --name | + | |
| - | -v / | + | |
| - | -v / | + | |
| - | yanwyb/ | + | |
| ``` | ``` | ||
| ==== Get convert tool ==== | ==== Get convert tool ==== | ||
| - | Download Tool from [[gl> | + | Download Tool from [[gh> |
| ```shell | ```shell | ||
| - | $ git clone https://gitlab.com/ | + | $ git lfs install |
| + | $ git lfs clone https://github.com/ | ||
| + | $ cd vim4_npu_sdk | ||
| + | $ ls | ||
| + | adla-toolkit-binary | ||
| ``` | ``` | ||
| + | |||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | <WRAP important> | ||
| + | If your kernel is older than 241129, please use branch npu-ddk-1.7.5.5. | ||
| + | </ | ||
| ==== Convert ==== | ==== Convert ==== | ||
| - | This demo is to convert | + | We first need to convert |
| ```shell | ```shell | ||
| Line 48: | Line 68: | ||
| ``` | ``` | ||
| - | Enter '' | + | Then we need to convert the TensorFlow model to an ADLA model ('' |
| + | |||
| + | Enter '' | ||
| ```sh convert_adla.sh | ```sh convert_adla.sh | ||
| Line 70: | Line 92: | ||
| --quantize-dtype int8 --outdir tensorflow_output \ | --quantize-dtype int8 --outdir tensorflow_output \ | ||
| --channel-mean-value " | --channel-mean-value " | ||
| + | --inference-input-type " | ||
| + | --inference-output-type " | ||
| --source-file vgg16_dataset.txt \ | --source-file vgg16_dataset.txt \ | ||
| --iterations 500 \ | --iterations 500 \ | ||
| Line 76: | Line 100: | ||
| ``` | ``` | ||
| - | Run '' | + | Run '' |
| ```shell | ```shell | ||
| Line 91: | Line 115: | ||
| $ git clone https:// | $ git clone https:// | ||
| ``` | ``` | ||
| + | |||
| + | <WRAP important> | ||
| + | If your kernel is older than 241129, please use version before tag ddk-3.4.7.7. | ||
| + | </ | ||
| ==== Install dependencies ==== | ==== Install dependencies ==== | ||
| Line 114: | Line 142: | ||
| # Run | # Run | ||
| - | $ sudo ./vgg16 -m ../ | + | $ ./vgg16 -m ../ |
| ``` | ``` | ||
| <WRAP tip > | <WRAP tip > | ||
| - | If your **vgg16** model classes | + | If your **VGG16** model classes |
| </ | </ | ||