Skip to content

Float16 image classification inference example python code #9866

@kexinzhao

Description

@kexinzhao

The usual scenario on the python end for float16 inference is as follows:

  1. We first train a model in float32 mode
  2. We use a float16_transpiler to modify the program desc and generate new float16 weights in the scope
  3. We run the inference engine in float16 mode to validate the correctness
  4. Use can save the program desc and the float16 weights to be used next time either on the python or c++ end.

2. We convert the float32 weights into float16, and save them on disk
3. During inference, we load the float16 weights and model, run inference engine in float16 mode.

We want to have example code on the python side to demonstrate the above steps.

Metadata

Metadata

Assignees

Labels

预测原名Inference,包含Capi预测问题等

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions