diff --git a/onnxruntime/core/graph/model.cc b/onnxruntime/core/graph/model.cc index 46cb19f531..3d03b2b4ef 100644 --- a/onnxruntime/core/graph/model.cc +++ b/onnxruntime/core/graph/model.cc @@ -3,6 +3,7 @@ #include "core/graph/model.h" #include +#include "core/common/logging/logging.h" #ifdef _MSC_VER #pragma warning(push) @@ -104,7 +105,21 @@ Model::Model(std::unique_ptr model_proto, const IOnnxRuntimeOpSchema std::unordered_map domain_to_version; for (auto& opSet : model_proto_->opset_import()) { - domain_to_version[opSet.domain()] = gsl::narrow_cast(opSet.version()); + const auto& domain = opSet.domain(); + const auto version = opSet.version(); + // empty domain and 'ai.onnx' are equivalent + if ((domain.empty() || domain == "ai.onnx") && version < 7) { + // TODO: Check if we can upgrade all the current opset 6 models that are being tested + // in CI to opset 7 or above + LOGS_DEFAULT(WARNING) << "ONNX Runtime only *guarantees* support for models stamped " + "with opset version 7 or above for opset domain 'ai.onnx'. " + "Please upgrade your model to opset 7 or higher. " + "For now, this opset " + << version + << " model may run depending upon legacy support " + "of some older opset version operators."; + } + domain_to_version[domain] = gsl::narrow_cast(version); } auto domain_map = schema_registry->GetLatestOpsetVersions(false); diff --git a/onnxruntime/test/contrib_ops/dynamic_slice_op_test.cc b/onnxruntime/test/contrib_ops/dynamic_slice_op_test.cc index fd590efbdc..3d450afd03 100644 --- a/onnxruntime/test/contrib_ops/dynamic_slice_op_test.cc +++ b/onnxruntime/test/contrib_ops/dynamic_slice_op_test.cc @@ -79,8 +79,8 @@ TEST(DynamicSliceTest, dynamic_slice_with_negative_axes) { OpTester test2 ("DynamicSlice", 1); test2.AddInput ("data", {3,3,3}, {1, 2, 3, 4, 5, 6, 7, 8, 9, - 10,11,12,13,14,15,16,17,18, - 19,20,21,22,23,24,25,26,27}); + 10,11,12,13,14,15,16,17,18, + 19,20,21,22,23,24,25,26,27}); test2.AddInput ("starts", {2}, {-3,0}); test2.AddInput ("ends", {2}, {-1,2}); test2.AddInput ("axes", {2}, {0,2});