Closed robthemonster closed 1 year ago
I believe this is caused because we require C++17.
As a workaround for being in a fixed environment, try installing coremltools
(just coremltools
not its dependencies) from source rather than doing a binary installation.
From a fresh environment, run:
pip install --no-binary coremltools coremltools
Installing this way means you will not have libmilstoragepython.so
. So you should not received the above error. However it also means you will have limited coremltools functionality. I believe this mainly means you will not be able to save or load mlpackages. I think mlmodels should still work fine. It's also important that you use the most recent version of coremltools (6.2) or you will receive an error when trying to import coremltools
.
@robthemonster - Let us know if this works for your use case. Or if you have any questions.
Thanks for the workaround; It sounds great for my use case. However, it seems I get a different error when I try this:
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
/tmp/ipykernel_179/2568829930.py in <module>
13 coreml_model = coremltools.converters.xgboost.convert(xgb_model,
14 mode="classifier",
---> 15 n_classes=2)
16
/export/apps/python/3.7/lib/python3.7/site-packages/coremltools/converters/xgboost/_tree.py in convert(model, feature_names, target, force_32bit_float, mode, class_labels, n_classes)
80 mode=mode,
81 class_labels=class_labels,
---> 82 n_classes=n_classes,
83 )
84 )
/export/apps/python/3.7/lib/python3.7/site-packages/coremltools/converters/xgboost/_tree_ensemble.py in convert_tree_ensemble(model, feature_names, target, force_32bit_float, mode, class_labels, n_classes)
150 """
151 if not (_HAS_XGBOOST):
--> 152 raise RuntimeError("xgboost not found. xgboost conversion API is disabled.")
153 accepted_modes = ["regressor", "classifier"]
154 if mode not in accepted_modes:
RuntimeError: xgboost not found. xgboost conversion API is disabled.
I do have
edit: This seems to have been an issue with my workspace, I got it working with your suggestion.
Thanks for your help (and for enabling this with 6.2)!xgboost
installed via pip and coremltools==4.1 was able to detect it (when installed via wheel). Do you think the --no-binary
flag causes coremltools to be unable to find it?
🐞Describing the bug
While I am able to import and use coremltools==4.1 in my environment, version 6.1 give me this error instead.
Stack Trace
To Reproduce
System environment (please complete the following information):
Additional context
I am working in a fixed environment, so I'm not able to change the version of
CXXABI
on my host. This issue blocks me from upgrading to any version of coremltools newer than 4.1; Since 4.1 only supports Python <=3.7, this also blocks our upgrade to a newer version of Python. Based on manual testing, every major release after 4.1 is incompatible.Is this new
CXXABI
dependency (moving from 4.1 to 5.x) expected? Is there a way to produce a compatible wheel?