Image Classification Based on MobileNetV2
1. Configure Docker development environment
Refer to here. After configuring the Docker development environment, return here to continue the next step.
If you are using a configured Docker development environment, please make sure to follow the Docker configuration tutorial to execute command source ./tpu-mlir/envsetup.sh
after starting Docker, otherwise errors may occur in subsequent steps.
2. Prepare the working directory in Docker
Create and enter the mobilenet_v2
working directory, note that it is a directory at the same level as tpu-mlir
.
# mkdir mobilenet_v2 && cd mobilenet_v2
Download the MobileNet model from the official website:
git clone https://github.com/shicai/MobileNet-Caffe.git
Place the model files in the cloned MobileNet-Caffe
directory and the image files in the tpu-mlir
tool chain directory into the current directory.
# cp MobileNet-Caffe/mobilenet_v2_deploy.prototxt .
# cp MobileNet-Caffe/mobilenet_v2.caffemodel .
# cp -rf ${TPUC_ROOT}/regression/dataset/ILSVRC2012/ .
# cp -rf ${TPUC_ROOT}/regression/image/ .
${TPUC_ROOT}
here is an environment variable, corresponding to the tpu-mlir
directory, which is loaded in the source ./tpu-mlir/envsetup.sh
step in the previous configuration of the Docker development environment.
Create and enter the work
working directory to store compiled files such as MLIR
and cvimodel
# mkdir work && cd work