34  
查询码: 00000075
推理示例模型resnet50安装和测试
专家 作者: 宋美霞 于 2024年11月29日 ,于 2025年05月13日 编辑

推理模型测试(ResNet50模型,x86架构,ubuntu系统为例)

1、安装Minconda3

获取地址:https://repo.anaconda.com/miniconda/
sh Miniconda3-latest-Linux-x86_64.sh
source /root/miniconda3/bin/activate
vi /root/.bashrc
export PATH=/root/miniconda3/bin:$PATH
source /root/.bashrc

2、创建属于自己的conda环境

conda create --name py310 python=3.10
conda env list
conda activate py310

3、安装模型依赖包

apt install -y libncursesw5 libjpeg-dev zlib1g-dev

pip3 install numpy==1.23.5

4、安装深度学习框架 (如果下载包timeout 切记加上 --default-timeout=300)

pip3 install torch-2.1.1+corex.4.1.2-cp310-cp310-linux_x86_64.whl

pip3 install igie-0.9.1+corex.4.1.2-cp310-cp310-linux_x86_64.whl

pip3 install ixrt-0.9.1+corex.4.1.2-cp310-cp310-linux_x86_64.whl

pip3 install tensorflow-2.12.0+corex.4.1.2-cp310-cp310-linux_x86_64.whl
pip3 install torchvision-0.16.0+corex.4.1.2-cp310-cp310-linux_x86_64.whl --default-timeout=300

5、安装示例脚本

bash corex-samples-4.1.2_x86_64.run

6、安装深度学习推理框架示例脚本

cp corex-inference-data-3.3.0.tar /root/corex-samples-4.1.2_x86_64/samples/inferencesamples/
cd /root/corex-samples-4.1.2_x86_64/samples/inferencesamples/
tar -xvf corex-inference-data-3.3.0.tar

7、准备推理前环境

cd /root/corex-samples-4.1.2_x86_64/samples/inferencesamples/
bash quick_build_environment.sh

8、以使用ResNet50模型并使用igie框架验证在INT8精度上的推理性能为例,运行以下演示脚本:

cd /root/corex-samples-4.1.2_x86_64/samples/inferencesamples/executables/resnet
bash init.sh
bash infer_resnet50_int8_performance_igie.sh

9、以使用ResNet50模型并使用ixrt接口框架验证在fp16精度上的推理性能为例,运行以下演示脚本:

cd /root/corex-samples-4.1.2_x86_64/samples/inferencesamples/executables/resnet
bash init.sh
bash infer_resnet50_fp16_performance_ixrt.sh

10、以使用ResNet50模型并使用igie框架验证在INT8精度上的验证精度为例,运行以下演示脚本:

cd /root/corex-samples-4.1.2_x86_64/samples/inferencesamples/executables/resnet
bash init.sh
bash infer_resnet50_int8_accuracy_igie.sh

11、以使用ResNet50模型并使用IxRT接口验证在FP16精度上的推理性能为例,运行以下演示脚本:

cd /root/corex-samples-4.1.2_x86_64/samples/inferencesamples/executables/resnet
bash init.sh
bash infer_resnet50_fp16_accuracy_ixrt.sh
笔记



  目录
    天数智芯知识库系统 -V 5.2.6 -wcp