### Details: There were two problems with memory sharing, which affected HF models. `value()` method of class `ResourceVariable` copies value of variable in some cases. This results in sharing of memory with a copied value, which is deallocated when `GraphIterator` finishes its work. Replaced `value()` with `read_value_no_copy()` which should not copy value in any case. Another problem is that original model inference moves weights to new location which leads to corruption of shared memory in OV model. So the original model should be inferred after the OV inference to prevent any changes in original model. ### Tickets: - 134787, 134408 --------- Co-authored-by: Roman Kazantsev <roman.kazantsev@intel.com> |
||
|---|---|---|
| .. | ||
| model_lists | ||
| conftest.py | ||
| requirements.txt | ||
| test_tf_convert_model.py | ||
| test_tf_hub_api_notebooks.py | ||
| utils.py | ||