有没有人想过如何使XGboost与苹果M1?协同工作
我尝试过多种方法来修复它,但它不起作用。
我试过重新安装它;pip和pip3以及python -m pip和conda安装;brew安装limpomp;brew安装gcc@8;下载源代码并在本地编译。
XGboost似乎不适用于苹果M1。
这里是错误,当我在我的脚本:中导入xgboost时会发生这种情况
XGBoostError: XGBoost Library (libxgboost.dylib) could not be loaded.
Likely causes:
* OpenMP runtime is not installed (vcomp140.dll or libgomp-1.dll for Windows, libomp.dylib for Mac OSX, libgomp.so for Linux and other UNIX-like OSes). Mac OSX users: Run `brew install libomp` to install OpenMP runtime.
* You are running 32-bit Python on a 64-bit OS
Error message(s): ['dlopen(/opt/anaconda3/envs/msc-env/lib/python3.8/site-packages/xgboost/lib/libxgboost.dylib, 6): Library not loaded: /usr/local/opt/libomp/lib/libomp.dylib\n Referenced from: /opt/anaconda3/envs/msc-env/lib/python3.8/site-packages/xgboost/lib/libxgboost.dylib\n Reason: image not found']
发布于 2021-03-31 01:42:04
我在MacBook Pro (13英寸,M1,2020)上看到了与苹果芯片M1相同的问题,幸运的是,经过几个小时的研究,我找到了解决方案,您只需遵循以下说明:
brew install libomp
conda install -c conda-forge py-xgboost
发布于 2021-03-31 03:29:27
https://discuss.xgboost.ai/t/xgboost-on-apple-m1/2004/8
樱桃(第一)和克里斯托福(第二)的答案结合在一起为我工作的微型锻造翻译:
确保安装了gcc-11 (和g+±11),如果不是这样做的话 brew安装gcc@11 brew安装cmake 然后,执行以下操作
git clone --recursive https://github.com/dmlc/xgboost
mkdir xgboost/my_build
cd xgboost/my_build
CC=gcc-11 CXX=g++-11 cmake ..
make -j4
cd ../python_package
/Users/xx/miniforge3/envs/MLEnv/bin/python setup.py install
在通往你的道路上
发布于 2021-12-16 19:46:41
在安装brew之前,我先将终端设置为Rosetta模式。通过这种方式,我基本上是在运行英特尔版本的软件包。我在这个要旨中提供了更多的细节。
https://stackoverflow.com/questions/65752489
复制相似问题