Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Build] error: no matching member function for call to 'min' #23413

Closed
yurivict opened this issue Jan 17, 2025 · 10 comments
Closed

[Build] error: no matching member function for call to 'min' #23413

yurivict opened this issue Jan 17, 2025 · 10 comments
Labels
build build issues; typically submitted using template

Comments

@yurivict
Copy link
Contributor

Describe the issue

Build fails:

/usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/onnxruntime/core/providers/cpu/math/element_wise_ops.cc:708:32: error: no matching member function for call to 'min'
  708 |     min = min.array().template min<Eigen::PropagateNaN>(EigenMap<float>(data_n).array());
      |           ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/../plugins/ArrayCwiseBinaryOps.h:33:28: note: candidate template ignored: invalid explicitly-specified argument for template parameter 'OtherDerived'
   33 | EIGEN_MAKE_CWISE_BINARY_OP(min,min)
      |                            ^
/usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/onnxruntime/core/providers/cpu/math/element_wise_ops.cc:760:53: error: no matching member function for call to 'min'
  760 |           output_vec_map = input_1_vec_map.template min<Eigen::PropagateNaN>(
      |                            ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/../plugins/ArrayCwiseBinaryOps.h:33:28: note: candidate template ignored: invalid explicitly-specified argument for template parameter 'OtherDerived'
   33 | EIGEN_MAKE_CWISE_BINARY_OP(min,min)
      |                            ^
/usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/onnxruntime/core/providers/cpu/math/element_wise_ops.cc:763:53: error: no matching member function for call to 'max'
  763 |           output_vec_map = input_1_vec_map.template max<Eigen::PropagateNaN>(
      |                            ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/../plugins/ArrayCwiseBinaryOps.h:59:28: note: candidate template ignored: invalid explicitly-specified argument for template parameter 'OtherDerived'
   59 | EIGEN_MAKE_CWISE_BINARY_OP(max,max)
      |                            ^
/usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/onnxruntime/core/providers/cpu/math/element_wise_ops.cc:777:53: error: no matching member function for call to 'min'
  777 |           output_vec_map = input_0_vec_map.template min<Eigen::PropagateNaN>(
      |                            ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/../plugins/ArrayCwiseBinaryOps.h:33:28: note: candidate template ignored: invalid explicitly-specified argument for template parameter 'OtherDerived'
   33 | EIGEN_MAKE_CWISE_BINARY_OP(min,min)
      |                            ^
/usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/onnxruntime/core/providers/cpu/math/element_wise_ops.cc:780:53: error: no matching member function for call to 'max'
  780 |           output_vec_map = input_0_vec_map.template max<Eigen::PropagateNaN>(
      |                            ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/../plugins/ArrayCwiseBinaryOps.h:59:28: note: candidate template ignored: invalid explicitly-specified argument for template parameter 'OtherDerived'
   59 | EIGEN_MAKE_CWISE_BINARY_OP(max,max)
      |                            ^
/usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/onnxruntime/core/providers/cpu/math/element_wise_ops.cc:797:53: error: no matching member function for call to 'min'
  797 |           output_vec_map = input_0_vec_map.template min<Eigen::PropagateNaN>(input_1_vec_map);
      |                            ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/../plugins/ArrayCwiseBinaryOps.h:33:28: note: candidate template ignored: invalid explicitly-specified argument for template parameter 'OtherDerived'
   33 | EIGEN_MAKE_CWISE_BINARY_OP(min,min)
      |                            ^
/usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/onnxruntime/core/providers/cpu/math/element_wise_ops.cc:799:53: error: no matching member function for call to 'max'
  799 |           output_vec_map = input_0_vec_map.template max<Eigen::PropagateNaN>(input_1_vec_map);
      |                            ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/../plugins/ArrayCwiseBinaryOps.h:59:28: note: candidate template ignored: invalid explicitly-specified argument for template parameter 'OtherDerived'
   59 | EIGEN_MAKE_CWISE_BINARY_OP(max,max)
      |                            ^
/usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/onnxruntime/core/providers/cpu/math/element_wise_ops.cc:835:32: error: no matching member function for call to 'max'
  835 |     max = max.array().template max<Eigen::PropagateNaN>(EigenMap<float>(data_n).array());
      |           ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/eigen3/Eigen/src/Core/../plugins/ArrayCwiseBinaryOps.h:59:28: note: candidate template ignored: invalid explicitly-specified argument for template parameter 'OtherDerived'
   59 | EIGEN_MAKE_CWISE_BINARY_OP(max,max)
      |                            ^
/usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/onnxruntime/core/providers/cpu/math/element_wise_ops.cc:724:61: error: no matching member function for call to 'min'
  724 |               per_iter_bh.EigenInput1<T>().array().template min<Eigen::PropagateNaN>(per_iter_bh.ScalarInput0<T>());
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/onnxruntime/core/providers/cpu/math/element_wise_ops.cc:722:42: note: while substituting into a lambda expression here
  722 |         [](BroadcastHelper& per_iter_bh) {
      |                                          ^
/usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/include/onnxruntime/core/framework/data_types_internal.h:368:17: note: in instantiation of member function 'onnxruntime::Min_8::ComputeImpl<float>::operator()' requested here
  368 |       result_ = std::forward<Fn>(fn)(std::forward<Args>(args)...);
      |                 ^
/usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/include/onnxruntime/core/framework/data_types_internal.h:543:25: note: in instantiation of function template specialization 'onnxruntime::utils::mltype_dispatcher_internal::CallableDispatchableRetHelper<onnxruntime::common::Status, onnxruntime::utils::mltype_dispatcher_internal::UnsupportedTypeDefaultPolicy<onnxruntime::common::Status>>::Invoke<float, onnxruntime::Min_8::ComputeImpl<float>, const onnxruntime::Min_8 &, onnxruntime::OpKernelContext *&>' requested here
  543 |         helper.template Invoke<Types>(
      |                         ^
/usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/include/onnxruntime/core/framework/data_types_internal.h:497:12: note: in instantiation of function template specialization 'onnxruntime::utils::MLTypeCallDispatcher<float, double, int, unsigned int, long, unsigned long>::InvokeRetWithUnsupportedPolicyAndLeadingTemplateArgs<onnxruntime::common::Status, onnxruntime::Min_8::ComputeImpl, onnxruntime::utils::mltype_dispatcher_internal::UnsupportedTypeDefaultPolicy<onnxruntime::common::Status>, onnxruntime::TypeList<>, const onnxruntime::Min_8 &, onnxruntime::OpKernelContext *&>' requested here
  497 |     return InvokeRetWithUnsupportedPolicyAndLeadingTemplateArgs<
      |            ^
/usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/include/onnxruntime/core/framework/data_types_internal.h:480:12: note: in instantiation of function template specialization 'onnxruntime::utils::MLTypeCallDispatcher<float, double, int, unsigned int, long, unsigned long>::InvokeRetWithUnsupportedPolicy<onnxruntime::common::Status, onnxruntime::Min_8::ComputeImpl, onnxruntime::utils::mltype_dispatcher_internal::UnsupportedTypeDefaultPolicy<onnxruntime::common::Status>, const onnxruntime::Min_8 &, onnxruntime::OpKernelContext *&>' requested here
  480 |     return InvokeRetWithUnsupportedPolicy<
      |            ^
/usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/onnxruntime/core/providers/cpu/math/element_wise_ops.cc:819:21: note: in instantiation of function template specialization 'onnxruntime::utils::MLTypeCallDispatcher<float, double, int, unsigned int, long, unsigned long>::InvokeRet<onnxruntime::common::Status, onnxruntime::Min_8::ComputeImpl, const onnxruntime::Min_8 &, onnxruntime::OpKernelContext *&>' requested here
  819 |       return t_disp.InvokeRet<Status, ComputeImpl>(*this, context);
      |                     ^
/usr/local/include/eigen3/Eigen/src/Core/../plugins/ArrayCwiseBinaryOps.h:33:28: note: candidate template ignored: invalid explicitly-specified argument for template parameter 'OtherDerived'
   33 | EIGEN_MAKE_CWISE_BINARY_OP(min,min)
      |                            ^
/usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/onnxruntime/core/providers/cpu/math/element_wise_ops.cc:728:61: error: no matching member function for call to 'min'
  728 |               per_iter_bh.EigenInput0<T>().array().template min<Eigen::PropagateNaN>(per_iter_bh.ScalarInput1<T>());
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/onnxruntime/core/providers/cpu/math/element_wise_ops.cc:726:42: note: while substituting into a lambda expression here
  726 |         [](BroadcastHelper& per_iter_bh) {
      |                                          ^
/usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/include/onnxruntime/core/framework/data_types_internal.h:368:17: note: in instantiation of member function 'onnxruntime::Min_8::ComputeImpl<float>::operator()' requested here
  368 |       result_ = std::forward<Fn>(fn)(std::forward<Args>(args)...);
      |                 ^
/usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/include/onnxruntime/core/framework/data_types_internal.h:543:25: note: in instantiation of function template specialization 'onnxruntime::utils::mltype_dispatcher_internal::CallableDispatchableRetHelper<onnxruntime::common::Status, onnxruntime::utils::mltype_dispatcher_internal::UnsupportedTypeDefaultPolicy<onnxruntime::common::Status>>::Invoke<float, onnxruntime::Min_8::ComputeImpl<float>, const onnxruntime::Min_8 &, onnxruntime::OpKernelContext *&>' requested here
  543 |         helper.template Invoke<Types>(
      |                         ^
/usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/include/onnxruntime/core/framework/data_types_internal.h:497:12: note: in instantiation of function template specialization 'onnxruntime::utils::MLTypeCallDispatcher<float, double, int, unsigned int, long, unsigned long>::InvokeRetWithUnsupportedPolicyAndLeadingTemplateArgs<onnxruntime::common::Status, onnxruntime::Min_8::ComputeImpl, onnxruntime::utils::mltype_dispatcher_internal::UnsupportedTypeDefaultPolicy<onnxruntime::common::Status>, onnxruntime::TypeList<>, const onnxruntime::Min_8 &, onnxruntime::OpKernelContext *&>' requested here
  497 |     return InvokeRetWithUnsupportedPolicyAndLeadingTemplateArgs<
      |            ^
/usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/include/onnxruntime/core/framework/data_types_internal.h:480:12: note: in instantiation of function template specialization 'onnxruntime::utils::MLTypeCallDispatcher<float, double, int, unsigned int, long, unsigned long>::InvokeRetWithUnsupportedPolicy<onnxruntime::common::Status, onnxruntime::Min_8::ComputeImpl, onnxruntime::utils::mltype_dispatcher_internal::UnsupportedTypeDefaultPolicy<onnxruntime::common::Status>, const onnxruntime::Min_8 &, onnxruntime::OpKernelContext *&>' requested here
  480 |     return InvokeRetWithUnsupportedPolicy<
      |            ^
/usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/onnxruntime/core/providers/cpu/math/element_wise_ops.cc:819:21: note: in instantiation of function template specialization 'onnxruntime::utils::MLTypeCallDispatcher<float, double, int, unsigned int, long, unsigned long>::InvokeRet<onnxruntime::common::Status, onnxruntime::Min_8::ComputeImpl, const onnxruntime::Min_8 &, onnxruntime::OpKernelContext *&>' requested here
  819 |       return t_disp.InvokeRet<Status, ComputeImpl>(*this, context);
      |                     ^
/usr/local/include/eigen3/Eigen/src/Core/../plugins/ArrayCwiseBinaryOps.h:33:28: note: candidate template ignored: invalid explicitly-specified argument for template parameter 'OtherDerived'
   33 | EIGEN_MAKE_CWISE_BINARY_OP(min,min)
      |                            ^
/usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/onnxruntime/core/providers/cpu/math/element_wise_ops.cc:732:61: error: no matching member function for call to 'min'
  732 |               per_iter_bh.EigenInput0<T>().array().template min<Eigen::PropagateNaN>(
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/onnxruntime/core/providers/cpu/math/element_wise_ops.cc:730:42: note: while substituting into a lambda expression here
  730 |         [](BroadcastHelper& per_iter_bh) {
      |                                          ^
/usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/include/onnxruntime/core/framework/data_types_internal.h:368:17: note: in instantiation of member function 'onnxruntime::Min_8::ComputeImpl<float>::operator()' requested here
  368 |       result_ = std::forward<Fn>(fn)(std::forward<Args>(args)...);
      |                 ^
/usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/include/onnxruntime/core/framework/data_types_internal.h:543:25: note: in instantiation of function template specialization 'onnxruntime::utils::mltype_dispatcher_internal::CallableDispatchableRetHelper<onnxruntime::common::Status, onnxruntime::utils::mltype_dispatcher_internal::UnsupportedTypeDefaultPolicy<onnxruntime::common::Status>>::Invoke<float, onnxruntime::Min_8::ComputeImpl<float>, const onnxruntime::Min_8 &, onnxruntime::OpKernelContext *&>' requested here
  543 |         helper.template Invoke<Types>(
      |                         ^
/usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/include/onnxruntime/core/framework/data_types_internal.h:497:12: note: in instantiation of function template specialization 'onnxruntime::utils::MLTypeCallDispatcher<float, double, int, unsigned int, long, unsigned long>::InvokeRetWithUnsupportedPolicyAndLeadingTemplateArgs<onnxruntime::common::Status, onnxruntime::Min_8::ComputeImpl, onnxruntime::utils::mltype_dispatcher_internal::UnsupportedTypeDefaultPolicy<onnxruntime::common::Status>, onnxruntime::TypeList<>, const onnxruntime::Min_8 &, onnxruntime::OpKernelContext *&>' requested here
  497 |     return InvokeRetWithUnsupportedPolicyAndLeadingTemplateArgs<
      |            ^
/usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/include/onnxruntime/core/framework/data_types_internal.h:480:12: note: in instantiation of function template specialization 'onnxruntime::utils::MLTypeCallDispatcher<float, double, int, unsigned int, long, unsigned long>::InvokeRetWithUnsupportedPolicy<onnxruntime::common::Status, onnxruntime::Min_8::ComputeImpl, onnxruntime::utils::mltype_dispatcher_internal::UnsupportedTypeDefaultPolicy<onnxruntime::common::Status>, const onnxruntime::Min_8 &, onnxruntime::OpKernelContext *&>' requested here
  480 |     return InvokeRetWithUnsupportedPolicy<
      |            ^
/usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/onnxruntime/core/providers/cpu/math/element_wise_ops.cc:819:21: note: in instantiation of function template specialization 'onnxruntime::utils::MLTypeCallDispatcher<float, double, int, unsigned int, long, unsigned long>::InvokeRet<onnxruntime::common::Status, onnxruntime::Min_8::ComputeImpl, const onnxruntime::Min_8 &, onnxruntime::OpKernelContext *&>' requested here
  819 |       return t_disp.InvokeRet<Status, ComputeImpl>(*this, context);
      |                     ^
/usr/local/include/eigen3/Eigen/src/Core/../plugins/ArrayCwiseBinaryOps.h:33:28: note: candidate template ignored: invalid explicitly-specified argument for template parameter 'OtherDerived'
   33 | EIGEN_MAKE_CWISE_BINARY_OP(min,min)
      |                            ^
/usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/onnxruntime/core/providers/cpu/math/element_wise_ops.cc:724:61: error: no matching member function for call to 'min'
  724 |               per_iter_bh.EigenInput1<T>().array().template min<Eigen::PropagateNaN>(per_iter_bh.ScalarInput0<T>());
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/onnxruntime/core/providers/cpu/math/element_wise_ops.cc:722:42: note: while substituting into a lambda expression here
  722 |         [](BroadcastHelper& per_iter_bh) {
      |                                          ^
/usr/ports/misc/onnxruntime/work/onnxruntime-1.20.1/include/onnxruntime/core/framework/data_types_internal.h:368:17: note: in instantiation of member function 'onnxruntime::Min_8::ComputeImpl<double>::operator()' requested here
  368 |       result_ = std::forward<Fn>(fn)(std::forward<Args>(args)...);
      |                 ^

Version: 1.20.1

Urgency

No response

Target platform

FreeBSD 14.2

Build script

Regular cmake invocation.

Error / output

See above.

Visual Studio Version

No response

GCC / Compiler Version

clang-18

@yurivict yurivict added the build build issues; typically submitted using template label Jan 17, 2025
@eKevinHoang
Copy link

I had the same issue.

This error occurs at all instances of the template minEigen::PropagateNaN function call, such as:

min = min.array().template min<Eigen::PropagateNaN>(EigenMap<float>(data_n).array());
output_vec_map = input_1_vec_map.template min<Eigen::PropagateNaN>();

@snnn
Copy link
Member

snnn commented Jan 17, 2025

You need to use the following eigen version:
https://gitlab.com/libeigen/eigen/-/archive/e7248b26a1ed53fa030c5c459f7ea095dfd276ac/eigen-e7248b26a1ed53fa030c5c459f7ea095dfd276ac.zip

Other versions are not tested. Especially, I know the latest eigen release(which was made 3 years ago) would not work. New CPUs (for example, ARM CPUs with SVE2) come out quickly, the code needs to be released more often to offer better support for the new CPU instructions.

@eKevinHoang
Copy link

Thank you @snnn for your support.

Eigen works, but I ran into another issue with Protobuf. The build process fails with the following error:

error: no member named 'ReleaseCleared' in 'google::protobuf::RepeatedPtrField<onnx::SparseTensorProto>'
delete graph_proto_->mutable_sparse_initializer()->ReleaseCleared();

So I have questions

  • What version of protobuf is recommended for building ONNX Runtime?
  • Are there any specific compatibility requirements or patches for protobuf when building ONNX Runtime?

@snnn
Copy link
Member

snnn commented Jan 18, 2025

The issue has been resolved in #23260

@snnn snnn closed this as completed Jan 18, 2025
@snnn
Copy link
Member

snnn commented Jan 18, 2025

Otherwise, please check protobuf's version number from cmake/deps.txt.

patches for protobuf

No.

@eKevinHoang
Copy link

Thanks @snnn

Thank @snnn for your assistance!

I have applied PR #23260 successfully. However, I encountered another issue during the build process, and I would appreciate your guidance to resolve it.

The error message is as follows:

/build/MacOS/RelWithDebInfo/tml.pb.h:12:2: error: This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer headers. Please update your headers
build/MacOS/RelWithDebInfo/tml.pb.h:32:10: fatal error: 'google/protobuf/map_entry_lite.h' file not found

It seems like there is a mismatch between the version of protoc used to generate the .pb.h files and the Protocol Buffer headers available during the build.

@snnn
Copy link
Member

snnn commented Jan 18, 2025

I guess you hit the code block at: https://github.com/microsoft/onnxruntime/blob/main/cmake/external/onnxruntime_external_deps.cmake#L117

So, please pass in -DONNX_CUSTOM_PROTOC_EXECUTABLE=/usr/bin/protoc

The code block was added for convenience, but it is really a headache now.

@eKevinHoang
Copy link

Thank @snnn for your guidance earlier!

Passing -ONNX_CUSTOM_PROTOC_EXECUTABLE=/usr/bin/protoc resolved the build issue, and I was able to successfully build ONNX Runtime. However, during the unit tests, I encountered the following issues:

Test Summary

71% tests passed, but 2 tests failed out of 7:

  • onnxruntime_test_all (Failed)
  • onnxruntime_shared_lib_test (Failed)

Error Logs

The logs indicate multiple schema registration errors. Below are some examples:

Schema error: Trying to register schema with name Abs (domain:  version: 1) from file /tmp/onnx-20250109-35561-66eeae/onnx-1.17.0/onnx/defs/math/old.cc line 2743, but it is already registered from file /tmp/onnx-20250109-35561-66eeae/onnx-1.17.0/onnx/defs/math/old.cc line 2743

Schema error: Trying to register schema with name Add (domain:  version: 1) from file /tmp/onnx-20250109-35561-66eeae/onnx-1.17.0/onnx/defs/math/old.cc line 2627, but it is already registered from file /tmp/onnx-20250109-35561-66eeae/onnx-1.17.0/onnx/defs/math/old.cc line 2627

Schema error: Trying to register schema with name ArgMax (domain:  version: 1) from file /tmp/onnx-20250109-35561-66eeae/onnx-1.17.0/onnx/defs/reduction/old.cc line 357, but it is already registered from file /tmp/onnx-20250109-35561-66eeae/onnx-1.17.0/onnx/defs/reduction/old.cc line 357

Additionally, there are some shape inference errors during some tests:

[ONNXRuntimeError] : 1 : FAIL : [ShapeInferenceError] Mismatch between number of inferred and declared dimensions. inferred=1 declared=2
[ONNXRuntimeError] : 1 : FAIL : [ShapeInferenceError] Can't merge shape info. Both inferred and declared dimension have values but they differ. Inferred=2 Declared=1 Dimension=0

Is there any specific configuration or known workaround for these errors?

Any help or suggestions to address these issues would be greatly appreciated. Thank you for your continued support!

@snnn
Copy link
Member

snnn commented Jan 18, 2025

We build ONNX with cmake option "ONNX_DISABLE_STATIC_REGISTRATION=ON". If you used a prebuilt ONNX library from somewhere else, unlikely it was built in such a way. Then it would cause a conflict when registering schemas.

@eKevinHoang
Copy link

I have applied PR #21897 and successfully built ONNX Runtime with ONNX 1.17.0. It includes a patch, so I couldn't build ONNX independently and had to rely on the ONNX Runtime build process to handle it.

I will now verify the inference results to check if there are any issues. I also hope this information can be helpful to someone else facing similar challenges.

Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build build issues; typically submitted using template
Projects
None yet
Development

No branches or pull requests

3 participants