This devcontainer is already configured for TPU-MLIR with all necessary dependencies to help you easily export bmodel files from onnx models.
-
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
-
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.
- Once the
devcontaineris set up and running, you can use the providedexport_bmodel.pyscript andconfig.yamlin/workspace/model_transformerdirectory to convert youronnxmodel tobmodel.
Export bmodel from yolov5s.onnx
- Create a directory for the model and download the
onnxfile 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.yamlfile as per your requirements. - Run the export script:
cd /workspace/model_transformer
python3 export_bmodel.py --config config.yaml
- Maintainer: W.M. Nipun Dhananjaya
- Email: nipun.dhananjaya@gmail.com