程序问答   发布时间:2022-06-02  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了英特尔模型动物园的 launch_benchmark.py 为 resnet34 失败大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

如何解决英特尔模型动物园的 launch_benchmark.py 为 resnet34 失败?

开发过程中遇到英特尔模型动物园的 launch_benchmark.py 为 resnet34 失败的问题如何解决?下面主要结合日常开发的经验,给出你关于英特尔模型动物园的 launch_benchmark.py 为 resnet34 失败的解决方法建议,希望对你解决英特尔模型动物园的 launch_benchmark.py 为 resnet34 失败有所启发或帮助;

在英特尔模型动物园 github(https://github.com/IntelAI/models) 中使用以下参数运行 launch_benchmark.py 时

python launch_benchmark.py --data-LOCATIOn /home/user/coco/output/ --in-graph /home/user/ssd_resnet34_fp32_bs1_preTrained_model.pb --model-source-dir /home/user/tensorflow/models --model-name ssd-resnet34 --framework tensorflow --precision fp32 --mode inference --socket-ID 0 --batch-size=1 --docker-image gcr.io/deeplearning-platform-release/tf-cpu.1-14 --accuracy-only

我收到以下错误:

Inference for accuracy check. 
TraceBACk (most recent call last):
file "/tmp/benchmarks/scripts/tf_cnn_benchmarks/models/ssd_model.py",line 507,in postprocess
import coco_metric # pylint: disable=g-import-not-at-top
file "/tmp/benchmarks/scripts/tf_cnn_benchmarks/coco_metric.py",line 32,in
from pycocotools.coco import COCO
file "/workspace/models/research/pycocotools/coco.py",line 55,in
from . import mask as maskUtils
file "/workspace/models/research/pycocotools/mask.py",line 3,in
import pycocotools._mask as _mask
importError: No module named 'pycocotools._mask'
The PYTHONPATH is :"/home/user/Tensorflowmodels/models/research:/home/user/Tensorflowmodels/models/research/slim"
/home/user/cocoAPI/PythonAPI was compiled with python3.6 and pycocotools was copIEd to /home/user/Tensorflowmodels/models/research.
The /home/user/IntelmodelsAI/benchmarks/launch_benchmark.py is also run with python3.6

解决方法

有一个用于 SSD-ResNet34 FP32 推理的模型工作负载容器。

https://software.intel.com/content/www/us/en/develop/articles/containers/ssd-resnet34-fp32-inference-tensorflow-container.html

此容器包含运行模型所需的所有代码、依赖代码/安装和预训练模型。您需要提供的只是预处理 COCO 数据集的路径和将写入日志文件的输出目录。该容器还包括用于常见用例的快速启动脚本。在您的情况下,您可以使用 fp32_accuracy.sh 脚本,该脚本使用与上述相同的参数(如批量大小 1、套接字 0 和仅精度)。

以下是如何使用容器运行 SSD-ResNet32 准确性测试的示例:

DATASET_DIR=/home/user/coco/outputOUTPUT_DIR=/home/user/logs

docker run \--env DATASET_DIR=${DATASET_DIR} \--env OUTPUT_DIR=${OUTPUT_DIR} \--volume ${DATASET_DIR}:${DATASET_DIR} \--volume ${OUTPUT_DIR}:${OUTPUT_DIR} \--privileged --init -t \intel/object-detection:tf-2.3.0-imz-2.2.0-ssd-resnet34-fp32-inference \/bin/bash quickstart/fp32_accuracy.sh

大佬总结

以上是大佬教程为你收集整理的英特尔模型动物园的 launch_benchmark.py 为 resnet34 失败全部内容,希望文章能够帮你解决英特尔模型动物园的 launch_benchmark.py 为 resnet34 失败所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。