Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

VSCODE Devcontainer for exporting bmodel from onnx models

This devcontainer is already configured for TPU-MLIR with all necessary dependencies to help you easily export bmodel files from onnx models.

Setup

  1. Pull the docker image:

    docker pull sophgo/tpuc_dev:v3.4
    • If the pulling fails, you can download the required image file from the official website development materials here
  2. Open this folder in VSCode as remote container:

    • Install the "Remote - Containers" extension in VSCode if you haven't already.
    • Open the command palette (Ctrl+Shift+P) and select "Remote-Containers: Open Folder in Container..."
    • Choose this folder to open it in the devcontainer.

Usage

  • Once the devcontainer is set up and running, you can use the provided export_bmodel.py script and config.yaml in /workspace/model_transformer directory to convert your onnx model to bmodel.

Example:

Export bmodel from yolov5s.onnx

  • Create a directory for the model and download the onnx file along with the required dataset and images:
cd /workspace
mkdir -p models/yolov5s && cd models/yolov5s
wget https://github.com/ultralytics/yolov5/releases/download/v6.0/yolov5s.onnx
cp -rf ../../tpu_mlir_resource/dataset/COCO2017 .
cp -rf ../../tpu_mlir_resource/image .
  • modify the config.yaml file as per your requirements.
  • Run the export script:
cd /workspace/model_transformer
python3 export_bmodel.py --config config.yaml

References:

Developer Information

About

vscode devcontainer for bmodel exporting with tpu-mlir

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages