mc2-project / federated-xgboost

Federated gradient boosted decision tree learning
68 stars 20 forks source link

AttributeError: module 'xgboost' has no attribute 'listen' #7

Closed hacql2004 closed 4 years ago

hacql2004 commented 4 years ago

Hi, when I tried to follow your demo(after executing 'python3 serve.py'), I met this error as below. image It seems my installed xgboost didn't support 'listen' function. However, I followed your prepare instructions strictly and installed the xgboost version by 'sudo python3 setup.py install' script sucessfully. Could you help me to analyse the reason for this error? Thanks in advance. PS: I've also tried it on official xgboost version(0.90), while got the same error.

chester-leung commented 4 years ago

Hi @hacql2004, I suspect that there's a Python package conflict issue. Federated XGBoost has a slightly different API from XGBoost (listen()) being one of the differences, so trying this with vanilla XGBoost won't work.

I've renamed the Python package installed by running sudo python3 setup.py install to federatedxgboost from xgboost in #8. This should hopefully resolve any conflict issues. Please try the installation again with the latest version of the codebase.

hacql2004 commented 4 years ago

Yeah, the problem has been sovled, thanks for your support. Here is a new bug(maybe). I think 'import logging' should be added in the code '/python-package/xgboost/src/federated.py', otherwise an error like "NameError: name 'logging' is not defined" might be reported.

chester-leung commented 4 years ago

Thanks for pointing this out! The bug was fixed in #8 as well.