fix fp16 inference

pull/1070/head
littletomatodonkey 2021-07-22 13:25:53 +08:00
parent 7032288692
commit fa9221479c
3 changed files with 36 additions and 1 deletions

View File

@ -22,6 +22,7 @@ PreProcess:
mean: [0.485, 0.456, 0.406]
std: [0.229, 0.224, 0.225]
order: ''
channel_num: 3
- ToCHWImage:
PostProcess:
main_indicator: Topk

View File

@ -0,0 +1,33 @@
Global:
infer_imgs: "./images/ILSVRC2012_val_00000010.jpeg"
inference_model_dir: "./models"
batch_size: 1
use_gpu: True
enable_mkldnn: True
cpu_num_threads: 10
enable_benchmark: True
use_fp16: False
ir_optim: True
use_tensorrt: False
gpu_mem: 8000
enable_profile: False
PreProcess:
transform_ops:
- ResizeImage:
resize_short: 256
- CropImage:
size: 224
- NormalizeImage:
scale: 0.00392157
mean: [0.485, 0.456, 0.406]
std: [0.229, 0.224, 0.225]
order: ''
channel_num: 4
- ToCHWImage:
PostProcess:
main_indicator: Topk
Topk:
topk: 5
class_id_map_file: "../ppcls/utils/imagenet1k_label_list.txt"
SavePreLabel:
save_dir: ./pre_label/

View File

@ -28,6 +28,7 @@ Arch:
name: ResNet50
class_num: 1000
input_image_channel: *image_channel
data_format: "NHWC"
# loss function config for traing/eval process
Loss:
@ -41,7 +42,7 @@ Loss:
Optimizer:
name: Momentum
momentum: 0.9
multi_precision: False # *use_pure_fp16
multi_precision: *use_pure_fp16
lr:
name: Piecewise
learning_rate: 0.1