Comments (4)
A pickled object is tied to the environment that produces it, including Python versions (you can run into invalid Python byte code when loading a Python object from a different Python version), XGBoost versions, and potentially all the dependencies that are loaded into the environment. It's basically a raw serialization.
Use save_model
from XGBoost to export the model if you want to reuse it in a different environment. See https://xgboost.readthedocs.io/en/stable/tutorials/saving_model.html#introduction-to-model-io
from xgboost.
Hello @trivialfis
Thanks for commenting. I instructed my team to read this and they have sent me the updated implementation. Now, at the beginning of our python script, we have
import xgboost
and already that is throwing an error:
2024-05-14 10:30:18 Traceback (most recent call last):
2024-05-14 10:30:18 File "/usr/local/lib/python3.10/site-packages/xgboost/compat.py", line 105, in <module>
2024-05-14 10:30:18 import pkg_resources
2024-05-14 10:30:18 File "/usr/local/lib/python3.10/site-packages/pkg_resources/__init__.py", line 32, in <module>
2024-05-14 10:30:18 import plistlib
2024-05-14 10:30:18 File "/usr/local/lib/python3.10/plistlib.py", line 61, in <module>
2024-05-14 10:30:18 from xml.parsers.expat import ParserCreate
2024-05-14 10:30:18 File "/usr/local/lib/python3.10/xml/parsers/expat.py", line 4, in <module>
2024-05-14 10:30:18 from pyexpat import *
2024-05-14 10:30:18 ImportError: libexpat.so.1: cannot open shared object file: No such file or directory
2024-05-14 10:30:18
2024-05-14 10:30:18 During handling of the above exception, another exception occurred:
2024-05-14 10:30:18
2024-05-14 10:30:18 Traceback (most recent call last):
2024-05-14 10:30:18 File "/app/Logic/Implementations/5/XGBoost_deploy_json.py", line 5, in <module>
2024-05-14 10:30:18 import xgboost as xgb
2024-05-14 10:30:18 File "/usr/local/lib/python3.10/site-packages/xgboost/__init__.py", line 9, in <module>
2024-05-14 10:30:18 from .core import DMatrix, DeviceQuantileDMatrix, Booster, DataIter, build_info
2024-05-14 10:30:18 File "/usr/local/lib/python3.10/site-packages/xgboost/core.py", line 20, in <module>
2024-05-14 10:30:18 from .compat import STRING_TYPES, DataFrame, py_str, PANDAS_INSTALLED
2024-05-14 10:30:18 File "/usr/local/lib/python3.10/site-packages/xgboost/compat.py", line 108, in <module>
2024-05-14 10:30:18 except pkg_resources.DistributionNotFound:
2024-05-14 10:30:18 NameError: name 'pkg_resources' is not defined
Is there any documentation which lists requirements for running XGBoost inside a docker container?
from xgboost.
Thank you for the update. I looked again, it appears to be an issue with pkg_resources
. The use of it was removed in xgboost 1.7 and all the later versions. You may try the latest xgboost instead.
from xgboost.
Updating to 1.7.1 solved the problem.
I spent days trying to resolve this, thank you!
from xgboost.
Related Issues (20)
- Missing surefire report of xgboost4j-spark HOT 1
- Segfaults in rabit tests HOT 11
- Hist training with checkpointing is non-deterministic based on subsample HOT 1
- XGBoost GPU Classification works / Regression does not HOT 1
- [R] Docs for function arguments format second paragraph as code block HOT 2
- XGBoost performance improvement using ARM SVE instrinsics
- [CI] Conda env for building with federated learning support.
- C-API : How to run classification HOT 2
- 2.1.0 Release Roadmap
- Failed to set feature types in R xgboost HOT 1
- Question: Import xgboost as new port in vcpkg repo, build failed for arm64_osx, arm64_uwp, arm64_windows... HOT 4
- Use CMAKE_MSVC_RUNTIME_LIBRARY to consistently handle linking mode for MSVC runtime
- Binary classification: target is probability instead of label?
- typo in `src/tree/updater_approx.cc` line 55 HOT 1
- 2.1.0 Release Candidate
- [CI] Migration to manylinux_2_28_x86_64 and rockylinux8
- Update the default CTK to 12.4.
- Update Python requirement to 3.10.
- Don't construct a column matrix when there's no missing value HOT 1
- Feature: C# package HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xgboost.