microsoft / onnxruntime

ONNX Runtime: cross-platform, high performance ML inferencing and training accelerator
https://onnxruntime.ai
MIT License
14.05k stars 2.83k forks source link

[Build] build python wheel fails #21145

Closed DaniAffCH closed 1 month ago

DaniAffCH commented 2 months ago

Describe the issue

Building the wheel from source fails on Ubuntu 22, but it builds successfully when using the tagged release v1.18.0.

Urgency

No response

Target platform

linux-x86_64

Build script

./build.sh --config Debug --enable_pybind --build_wheel --build_shared_lib

Error / output

error: no matching function for call to ‘pybind11::dtype::dtype(NPY_TYPES)’
  173 |   py::array result(py::dtype(NPY_OBJECT), tensor.Shape().GetDims());

[...]
: error: no matching function for call to ‘pybind11::dtype::dtype(const int&)’
  197 |   pybind11::array result(py::dtype(numpy_type), tensor.Shape().GetDims(),
[...]
/home/daniaffch/Desktop/gsoc/onnxruntime/onnxruntime/python/onnxruntime_pybind_state.cc:197:36: error: invalid conversion from ‘int’ to ‘const char*’ [-fpermissive]
  197 |   pybind11::array result(py::dtype(numpy_type), tensor.Shape().GetDims(),

Visual Studio Version

No response

GCC / Compiler Version

11.4.0

tianleiwu commented 2 months ago

@DaniAffCH, It seems to be related to numpy version. Could you try different numpy version (1.26 vs 2.0) with main branch as well?

DaniAffCH commented 2 months ago

@tianleiwu thank you for the support. I tried both versions of numpy but the same issue persists.

github-actions[bot] commented 1 month ago

This issue has been automatically marked as stale due to inactivity and will be closed in 30 days if no further activity occurs. If further support is needed, please provide an update and/or more details.