Git Product home page Git Product logo

Comments (4)

trivialfis avatar trivialfis commented on June 3, 2024

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.

neman-je avatar neman-je commented on June 3, 2024

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.

trivialfis avatar trivialfis commented on June 3, 2024

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.

neman-je avatar neman-je commented on June 3, 2024

Updating to 1.7.1 solved the problem.

I spent days trying to resolve this, thank you!

from xgboost.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.