Created by: kexinzhao
Fix #7221 (closed)
This pr addresses comments by @Xreki on #7636.
It fixes the following issues:
- Remove unused LoadInferenceModel() function
- Use a better way to detect if a variable is a feed var.
- Allow user to pass different feed/fetch var names other than the default
feed
andfetch
- Remove dependency on pickle when saving / loading inference model
- Because of the change in save/load_inference_model function, the executor.run() method in executor.py is also modified to also handle the situation where the loaded inference model has already been prepended/appended feed/fetch operator (it will throw error when the info contained in the already attached feed/fetch ops do not match the
feed
andfetch_list
input arguments)
TODO: In the future PR, we will also create a new executor.run() function in the C++ executor class to mimic how executor.py handle ProgramDesc in this PR.