Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问再CPU环境下如何测试时间是2-3ms呢,相同模型我测试运行时间是400多ms呢,即使只算推理部分也100多ms #3250

Closed
carter275 opened this issue Sep 17, 2024 · 4 comments
Assignees

Comments

@carter275
Copy link

欢迎您使用PaddleClas并反馈相关问题,非常感谢您对PaddleClas的贡献!
提出issue时,辛苦您提供以下信息,方便我们快速定位问题并及时有效地解决您的问题:

  1. PaddleClas版本以及PaddlePaddle版本:请您提供您使用的版本号或分支信息,如PaddleClas release/2.2和PaddlePaddle 2.1.0
  2. 涉及的其他产品使用的版本号:如您在使用PaddleClas的同时还在使用其他产品,如PaddleServing、PaddleInference等,请您提供其版本号
  3. 训练环境信息:
    a. 具体操作系统,如Linux/Windows/MacOS
    b. Python版本号,如Python3.6/7/8
    c. CUDA/cuDNN版本, 如CUDA10.2/cuDNN 7.6.5等
  4. 完整的代码(相比于repo中代码,有改动的地方)、详细的错误信息及相关log
@carter275
Copy link
Author

== PaddleClas is powered by PaddlePaddle ! ==

== ==
== For more info please go to the following website. ==
== ==
== https://github.com/PaddlePaddle/PaddleClas ==

2024-09-17 00:48:58 INFO: Global :
2024-09-17 00:48:58 INFO: batch_size : 1
2024-09-17 00:48:58 INFO: cpu_num_threads : 10
2024-09-17 00:48:58 INFO: enable_benchmark : True
2024-09-17 00:48:58 INFO: enable_mkldnn : True
2024-09-17 00:48:58 INFO: enable_profile : False
2024-09-17 00:48:58 INFO: gpu_mem : 8000
2024-09-17 00:48:58 INFO: infer_imgs : /home/aistudio/gai/test/9/NG/20240911_153540_790.bmp
2024-09-17 00:48:58 INFO: inference_model_dir : /home/aistudio/deploy
2024-09-17 00:48:58 INFO: ir_optim : True
2024-09-17 00:48:58 INFO: use_fp16 : False
2024-09-17 00:48:58 INFO: use_gpu : False
2024-09-17 00:48:58 INFO: use_tensorrt : False
2024-09-17 00:48:58 INFO: PostProcess :
2024-09-17 00:48:58 INFO: SavePreLabel :
2024-09-17 00:48:58 INFO: save_dir : ./pre_label/
2024-09-17 00:48:58 INFO: Topk :
2024-09-17 00:48:58 INFO: class_id_map_file : /home/aistudio/gai/label.txt
2024-09-17 00:48:58 INFO: topk : 3
2024-09-17 00:48:58 INFO: main_indicator : Topk
2024-09-17 00:48:58 INFO: PreProcess :
2024-09-17 00:48:58 INFO: transform_ops :
2024-09-17 00:48:58 INFO: ResizeImage :
2024-09-17 00:48:58 INFO: resize_short : 256
2024-09-17 00:48:58 INFO: CropImage :
2024-09-17 00:48:58 INFO: size : 224
2024-09-17 00:48:58 INFO: NormalizeImage :
2024-09-17 00:48:58 INFO: channel_num : 3
2024-09-17 00:48:58 INFO: mean : [0.485, 0.456, 0.406]
2024-09-17 00:48:58 INFO: order :
2024-09-17 00:48:58 INFO: scale : 0.00392157
2024-09-17 00:48:58 INFO: std : [0.229, 0.224, 0.225]
2024-09-17 00:48:58 INFO: ToCHWImage : None
预测代码运行时间: 0.1401 秒
20240911_153540_790.bmp: class id(s): [0, 1], score(s): [0.56, 0.44], label_name(s): ['OK', 'NG']
代码运行时间: 0.3865 秒

@carter275
Copy link
Author

2024-09-17 08:42:38 INFO: Global :
2024-09-17 08:42:38 INFO: batch_size : 1
2024-09-17 08:42:38 INFO: cpu_num_threads : 10
2024-09-17 08:42:38 INFO: enable_benchmark : True
2024-09-17 08:42:38 INFO: enable_mkldnn : True
2024-09-17 08:42:38 INFO: enable_profile : False
2024-09-17 08:42:38 INFO: gpu_mem : 8000
2024-09-17 08:42:38 INFO: infer_imgs : /home/aistudio/gai/test/NG
2024-09-17 08:42:38 INFO: inference_model_dir : /home/aistudio/deploy
2024-09-17 08:42:38 INFO: ir_optim : True
2024-09-17 08:42:38 INFO: use_fp16 : False
2024-09-17 08:42:38 INFO: use_gpu : False
2024-09-17 08:42:38 INFO: use_tensorrt : False
2024-09-17 08:42:38 INFO: PostProcess :
2024-09-17 08:42:38 INFO: SavePreLabel :
2024-09-17 08:42:38 INFO: save_dir : ./pre_label/
2024-09-17 08:42:38 INFO: Topk :
2024-09-17 08:42:38 INFO: class_id_map_file : /home/aistudio/gai/label.txt
2024-09-17 08:42:38 INFO: topk : 3
2024-09-17 08:42:38 INFO: main_indicator : Topk
2024-09-17 08:42:38 INFO: PreProcess :
2024-09-17 08:42:38 INFO: transform_ops :
2024-09-17 08:42:38 INFO: ResizeImage :
2024-09-17 08:42:38 INFO: resize_short : 256
2024-09-17 08:42:38 INFO: CropImage :
2024-09-17 08:42:38 INFO: size : 224
2024-09-17 08:42:38 INFO: NormalizeImage :
2024-09-17 08:42:38 INFO: channel_num : 3
2024-09-17 08:42:38 INFO: mean : [0.485, 0.456, 0.406]
2024-09-17 08:42:38 INFO: order :
2024-09-17 08:42:38 INFO: scale : 0.00392157
2024-09-17 08:42:38 INFO: std : [0.229, 0.224, 0.225]
2024-09-17 08:42:38 INFO: ToCHWImage : None
预测代码运行时间: 0.6187 秒
20240911_153410_348.bmp: class id(s): [1, 0], score(s): [1.00, 0.00], label_name(s): ['NG', 'OK']
预测代码运行时间: 0.0967 秒
20240911_153811_895.bmp: class id(s): [1, 0], score(s): [1.00, 0.00], label_name(s): ['NG', 'OK']
预测代码运行时间: 0.0155 秒
20240911_153812_977.bmp: class id(s): [1, 0], score(s): [0.92, 0.08], label_name(s): ['NG', 'OK']
预测代码运行时间: 0.0050 秒
20240911_153817_810.bmp: class id(s): [1, 0], score(s): [1.00, 0.00], label_name(s): ['NG', 'OK']
预测代码运行时间: 0.0913 秒
20240911_154550_690.bmp: class id(s): [1, 0], score(s): [0.95, 0.05], label_name(s): ['NG', 'OK']
预测代码运行时间: 0.0934 秒
20240911_154613_782.bmp: class id(s): [1, 0], score(s): [0.75, 0.25], label_name(s): ['NG', 'OK']
预测代码运行时间: 0.0945 秒
20240911_154635_839.bmp: class id(s): [1, 0], score(s): [0.51, 0.49], label_name(s): ['NG', 'OK']
预测代码运行时间: 0.0949 秒
20240911_155645_207.bmp: class id(s): [0, 1], score(s): [0.61, 0.39], label_name(s): ['OK', 'NG']
预测代码运行时间: 0.0159 秒
20240911_155703_216.bmp: class id(s): [1, 0], score(s): [1.00, 0.00], label_name(s): ['NG', 'OK']
预测代码运行时间: 0.1067 秒
20240911_155704_282.bmp: class id(s): [1, 0], score(s): [0.82, 0.18], label_name(s): ['NG', 'OK']
预测代码运行时间: 0.0961 秒
20240911_155731_509.bmp: class id(s): [1, 0], score(s): [0.83, 0.17], label_name(s): ['NG', 'OK']
预测代码运行时间: 0.1899 秒
20240911_155739_086.bmp: class id(s): [1, 0], score(s): [1.00, 0.00], label_name(s): ['NG', 'OK']
预测代码运行时间: 0.1879 秒
20240911_155753_362.bmp: class id(s): [1, 0], score(s): [0.93, 0.07], label_name(s): ['NG', 'OK']
预测代码运行时间: 0.0946 秒
20240911_155806_174.bmp: class id(s): [1, 0], score(s): [1.00, 0.00], label_name(s): ['NG', 'OK']
预测代码运行时间: 0.1944 秒
20240911_161528_831.bmp: class id(s): [1, 0], score(s): [0.99, 0.01], label_name(s): ['NG', 'OK']
预测代码运行时间: 0.0064 秒
20240911_161535_665.bmp: class id(s): [1, 0], score(s): [0.98, 0.02], label_name(s): ['NG', 'OK']
预测代码运行时间: 0.0073 秒
20240911_161537_160.bmp: class id(s): [1, 0], score(s): [0.98, 0.02], label_name(s): ['NG', 'OK']
预测代码运行时间: 0.1034 秒
20240911_161538_510.bmp: class id(s): [1, 0], score(s): [1.00, 0.00], label_name(s): ['NG', 'OK']
预测代码运行时间: 0.0124 秒
20240911_161936_063.bmp: class id(s): [1, 0], score(s): [0.99, 0.01], label_name(s): ['NG', 'OK']
预测代码运行时间: 0.0956 秒
20240911_161938_079.bmp: class id(s): [1, 0], score(s): [0.99, 0.01], label_name(s): ['NG', 'OK']
预测代码运行时间: 0.0120 秒
20240911_161955_288.bmp: class id(s): [0, 1], score(s): [0.76, 0.24], label_name(s): ['OK', 'NG']
预测代码运行时间: 0.0949 秒
20240911_161956_487.bmp: class id(s): [1, 0], score(s): [1.00, 0.00], label_name(s): ['NG', 'OK']
预测代码运行时间: 0.0197 秒
20240911_162004_202.bmp: class id(s): [1, 0], score(s): [0.57, 0.43], label_name(s): ['NG', 'OK']
代码运行时间: 3.5929 秒

@zhangyubo0722
Copy link
Collaborator

使用的是同一型号的CPU吗

@TingquanGao
Copy link
Collaborator

The issue has no response for a long time and will be closed. You can reopen or new another issue if are still confused.


From Bot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants