forked from openvinotoolkit/nncf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Common api prepare_for_inference for controllers (openvinotoolkit#1612)
### Changes Add `prepare_for_inference` to common api for PyTorch orch and TF Controllers. PyTorch implementation: openvinotoolkit#1526 1. Move `prepare_for_inference` logics to `strip_model` method for PT. (before strip_model do nothing, get model and return same model) 2. Add make_model_copy argument to `strip_model`, defaults value is False. 3. Add to `copy_model` from `nncf/common/utils/backend.py` logic to copy TF model via TFModelTransformer. (deepcopy, tf.keras.model_copy do not work as expected) 4. Removed `infer_backend_from_compression_controller` function because was import cycle and `infer_backend_from_compression_controller` is longer than use `get_backend`. ```python infer_backend_from_compression_controller(compression_ctrl) # Changed to get_bakend(compression_ctrl.model) ``` 5. In torch examples for `--prepare_for_inference` used export via `torch.onnx.export` 6. Add TF examples with export models without using `ctrl.export_model` method. ### Related tickets 92247
- Loading branch information
1 parent
af4a4d2
commit 32fe3ab
Showing
41 changed files
with
599 additions
and
351 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.