模型量化之后怎么加载int数据类型
Created by: thunder95
量化训练之后有float和int两种数类型的模型文件
float加载推理没有任何问题,但是int该怎么加载? 运行命令如下:
python deploy/python/infer.py --model_dir=myfiles/quant_export/int --image_file=/d/hl_files/4_10_2_0003.jpg --use_gpu=True --run_mode fluid --run_benchmark=True
------------------------------------------
Python Call Stacks (More useful to users):
------------------------------------------
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/framework.py", line 2610, in append_op
attrs=kwargs.get("attrs", None))
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/layer_helper.py", line 43, in append_op
return self.main_program.current_block().append_op(*args, **kwargs)
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/layers/nn.py", line 2933, in conv2d
"data_format": data_format,
File "/home/aistudio/work/PaddleDetection/ppdet/modeling/backbones/mobilenet.py", line 84, in _conv_norm
bias_attr=False)
File "/home/aistudio/work/PaddleDetection/ppdet/modeling/backbones/mobilenet.py", line 159, in __call__
input, 3, int(32 * scale), 2, 1, name=self.prefix_name + "conv1")
File "/home/aistudio/work/PaddleDetection/ppdet/modeling/architectures/yolo.py", line 61, in build
body_feats = self.backbone(im)
File "/home/aistudio/work/PaddleDetection/ppdet/modeling/architectures/yolo.py", line 162, in test
return self.build(feed_vars, mode='test')
File "export_model.py", line 77, in main
test_fetches = model.test(feed_vars)
File "export_model.py", line 122, in <module>
main()
----------------------
Error Message Summary:
----------------------
InvalidArgumentError: input and filter data type should be consistent
[Hint: Expected input_data_type == filter_data_type, but received input_data_type:5 != filter_data_type:21.] at (/d/hl_files/Paddle/paddle/fluid/operators/conv_op.cc:173)
[operator < conv2d > error]