Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[Py OV] Fix export_model() fails Unable to cast Python instance of type <class 'int'> to C++ type 'int' (#30468)

Alicja Miloszewska239eef520387
diff --git a/src/bindings/python/src/pyopenvino/utils/utils.hpp b/src/bindings/python/src/pyopenvino/utils/utils.hpp
index 86d73d18d1c..a4673f679f5 100644
--- a/src/bindings/python/src/pyopenvino/utils/utils.hpp
+++ b/src/bindings/python/src/pyopenvino/utils/utils.hpp
@@ -66,7 +66,7 @@ protected:
if (python_direction == -1) {
return pos_type(off_type(-1));
}
- const auto abs_pos = m_py_stream.attr("seek")(off, python_direction).cast<int>();
+ const auto abs_pos = m_py_stream.attr("seek")(off, python_direction).cast<int64_t>();
return pos_type(abs_pos);
}