2016-07-04 4 views
3

verursachen möchte ich gemäß den Anweisungen des Pakets xgboost in R installieren:eigentümliche Installation Warnung Pakete Störung

install.packages("drat", repos="https://cran.rstudio.com") 
drat:::addRepo("dmlc") 
install.packages("xgboost", repos="http://dmlc.ml/drat/", type = "source") 

Die Installation der ersten beiden Pakete scheint gut zu funktionieren:

install.packages("drat", repos="https://cran.rstudio.com") 
    % Total % Received % Xferd Average Speed Time Time  Time Current 
           Dload Upload Total Spent Left Speed 
    0  0 0  0 0  0  0  0 --:--:-- --:--:-- --:--:--  0 0 49369 0  0 0  0  0  0 --:--:-- 0:00:01 --:--:--  0100 49369 100 49369 0  0 40981  0 0:00:01 0:00:01 --:--:-- 41004 

The downloaded binary packages are in 
    /var/folders/sx/c5z57jp103s493xxcn9bhvwc0000gn/T//RtmpluolUL/downloaded_packages 

drat:::addRepo("dmlc") 

aber die endgültige Installation von xgboost ist wirklich unregelmäßig und ich konnte den Fehler in einem frühen Beitrag nicht fid:

% Total % Received % Xferd Average Speed Time Time  Time Current 
           Dload Upload Total Spent Left Speed 
    0  0 0  0 0  0  0  0 --:--:-- --:--:-- --:--:--  0100 351k 100 351k 0  0 550k  0 --:--:-- --:--:-- --:--:-- 550k 
* installing *source* package ‘xgboost’ ... 
** libs 
clang++ -std=c++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I./include -I./dmlc-core/include -I./rabit/include -I. -DXGBOOST_STRICT_R_MODE=1 -DDMLC_LOG_BEFORE_THROW=0 -DDMLC_ENABLE_STD_THREAD=0 -DDMLC_DISABLE_STDIN=1 -DDMLC_LOG_CUSTOMIZE=1 -DXGBOOST_CUSTOMIZE_LOGGER=1 -DRABIT_CUSTOMIZE_MSG_ -DRABIT_STRICT_CXX98_ -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include  -fPIC -Wall -mtune=core2 -g -O2 -c xgboost_R.cc -o xgboost_R.o 
In file included from xgboost_R.cc:3: 
./dmlc-core/include/dmlc/omp.h:13:9: warning: Warning: OpenMP is not available, project will be compiled into single-thread code. Use OpenMP-enabled compiler to get benefit of multi-threading. [-W#pragma-messages] 
#pragma message("Warning: OpenMP is not available, "     \ 
     ^
1 warning generated. 
clang++ -std=c++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I./include -I./dmlc-core/include -I./rabit/include -I. -DXGBOOST_STRICT_R_MODE=1 -DDMLC_LOG_BEFORE_THROW=0 -DDMLC_ENABLE_STD_THREAD=0 -DDMLC_DISABLE_STDIN=1 -DDMLC_LOG_CUSTOMIZE=1 -DXGBOOST_CUSTOMIZE_LOGGER=1 -DRABIT_CUSTOMIZE_MSG_ -DRABIT_STRICT_CXX98_ -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include  -fPIC -Wall -mtune=core2 -g -O2 -c xgboost_custom.cc -o xgboost_custom.o 
In file included from xgboost_custom.cc:5: 
In file included from ./include/xgboost/logging.h:13: 
In file included from ./include/xgboost/./base.h:10: 
./dmlc-core/include/dmlc/omp.h:13:9: warning: Warning: OpenMP is not available, project will be compiled into single-thread code. Use OpenMP-enabled compiler to get benefit of multi-threading. [-W#pragma-messages] 
#pragma message("Warning: OpenMP is not available, "     \ 
     ^
1 warning generated. 
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I./include -I./dmlc-core/include -I./rabit/include -I. -DXGBOOST_STRICT_R_MODE=1 -DDMLC_LOG_BEFORE_THROW=0 -DDMLC_ENABLE_STD_THREAD=0 -DDMLC_DISABLE_STDIN=1 -DDMLC_LOG_CUSTOMIZE=1 -DXGBOOST_CUSTOMIZE_LOGGER=1 -DRABIT_CUSTOMIZE_MSG_ -DRABIT_STRICT_CXX98_ -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -fPIC -Wall -mtune=core2 -g -O2 -c xgboost_assert.c -o xgboost_assert.o 
clang++ -std=c++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I./include -I./dmlc-core/include -I./rabit/include -I. -DXGBOOST_STRICT_R_MODE=1 -DDMLC_LOG_BEFORE_THROW=0 -DDMLC_ENABLE_STD_THREAD=0 -DDMLC_DISABLE_STDIN=1 -DDMLC_LOG_CUSTOMIZE=1 -DXGBOOST_CUSTOMIZE_LOGGER=1 -DRABIT_CUSTOMIZE_MSG_ -DRABIT_STRICT_CXX98_ -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include  -fPIC -Wall -mtune=core2 -g -O2 -c amalgamation/xgboost-all0.cc -o amalgamation/xgboost-all0.o 
In file included from amalgamation/xgboost-all0.cc:13: 
In file included from amalgamation/../src/metric/metric.cc:6: 
In file included from ./include/xgboost/metric.h:14: 
In file included from ./include/xgboost/./data.h:15: 
In file included from ./include/xgboost/./base.h:10: 
./dmlc-core/include/dmlc/omp.h:13:9: warning: Warning: OpenMP is not available, project will be compiled into single-thread code. Use OpenMP-enabled compiler to get benefit of multi-threading. [-W#pragma-messages] 
#pragma message("Warning: OpenMP is not available, "     \ 
     ^
1 warning generated. 
clang++ -std=c++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I./include -I./dmlc-core/include -I./rabit/include -I. -DXGBOOST_STRICT_R_MODE=1 -DDMLC_LOG_BEFORE_THROW=0 -DDMLC_ENABLE_STD_THREAD=0 -DDMLC_DISABLE_STDIN=1 -DDMLC_LOG_CUSTOMIZE=1 -DXGBOOST_CUSTOMIZE_LOGGER=1 -DRABIT_CUSTOMIZE_MSG_ -DRABIT_STRICT_CXX98_ -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include  -fPIC -Wall -mtune=core2 -g -O2 -c amalgamation/dmlc-minimum0.cc -o amalgamation/dmlc-minimum0.o 
In file included from amalgamation/dmlc-minimum0.cc:8: 
amalgamation/../dmlc-core/src/io/input_split_base.cc:26:22: warning: assigning field to itself [-Wself-assign-field] 
    this->align_bytes_ = align_bytes_; 
        ^
In file included from amalgamation/dmlc-minimum0.cc:10: 
In file included from amalgamation/../dmlc-core/src/data.cc:12: 
In file included from amalgamation/../dmlc-core/src/data/disk_row_iter.h:19: 
In file included from amalgamation/../dmlc-core/src/data/./libsvm_parser.h:13: 
In file included from amalgamation/../dmlc-core/src/data/./text_parser.h:11: 
./dmlc-core/include/dmlc/omp.h:13:9: warning: Warning: OpenMP is not available, project will be compiled into single-thread code. Use OpenMP-enabled compiler to get benefit of multi-threading. [-W#pragma-messages] 
#pragma message("Warning: OpenMP is not available, "     \ 
     ^
2 warnings generated. 
clang++ -std=c++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I./include -I./dmlc-core/include -I./rabit/include -I. -DXGBOOST_STRICT_R_MODE=1 -DDMLC_LOG_BEFORE_THROW=0 -DDMLC_ENABLE_STD_THREAD=0 -DDMLC_DISABLE_STDIN=1 -DDMLC_LOG_CUSTOMIZE=1 -DXGBOOST_CUSTOMIZE_LOGGER=1 -DRABIT_CUSTOMIZE_MSG_ -DRABIT_STRICT_CXX98_ -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include  -fPIC -Wall -mtune=core2 -g -O2 -c rabit/src/engine_empty.cc -o rabit/src/engine_empty.o 
clang++ -std=c++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I./include -I./dmlc-core/include -I./rabit/include -I. -DXGBOOST_STRICT_R_MODE=1 -DDMLC_LOG_BEFORE_THROW=0 -DDMLC_ENABLE_STD_THREAD=0 -DDMLC_DISABLE_STDIN=1 -DDMLC_LOG_CUSTOMIZE=1 -DXGBOOST_CUSTOMIZE_LOGGER=1 -DRABIT_CUSTOMIZE_MSG_ -DRABIT_STRICT_CXX98_ -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include  -fPIC -Wall -mtune=core2 -g -O2 -c rabit/src/c_api.cc -o rabit/src/c_api.o 
clang++ -std=c++11 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o xgboost.so ./xgboost_R.o ./xgboost_custom.o ./xgboost_assert.o ./amalgamation/xgboost-all0.o ./amalgamation/dmlc-minimum0.o ./rabit/src/engine_empty.o ./rabit/src/c_api.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation 
installing to /Library/Frameworks/R.framework/Versions/3.2/Resources/library/xgboost/libs 
** R 
** data 
** demo 
** preparing package for lazy loading 
** help 
*** installing help indices 
** building package indices 
** installing vignettes 
** testing if installed package can be loaded 
* DONE (xgboost) 

The downloaded source packages are in 
    ‘/private/var/folders/sx/c5z57jp103s493xxcn9bhvwc0000gn/T/RtmpluolUL/downloaded_packages’ 

Das Paket nicht richtig herunterladen und daher gibt es die folgende Fehlermeldung, wenn ich versuche auf einem Datensatz zu laufen xgboost:

Error in xgb.DMatrix(data, label = label, missing = missing) : 
    [14:53:26] amalgamation/../dmlc-core/src/io/local_filesys.cc:61: LocalFileSystem.GetPathInfo 201-225 Error:No such file or directory 
+1

Haben Sie versucht, sicherzustellen, dass Sie OpenMP haben? –

+0

Übergeben Sie eine 'model.matrix' in die' xgb.DMatrix() 'Funktion? Siehe [dieser Beitrag] (https://github.com/dmlc/xgboost/issues/1480). –

Antwort

0

Versuchen schließen R dann für sie Ihren aktuellen Library-Ordner zu löschen und es auf diese Weise neu zu installieren:

if(!require("pacman")) install.packages("pacman") 
pacman::p_load(xgboost) 

pacman, die ein Kunstwort aus Pac kage ist man ager, gibt Ihnen einen Paket-Manager die Paketinstallation anstatt zu versuchen, etwas manuell zu verwalten zu installieren. Dies ist (mehr oder weniger) der gleiche Grund, warum Leute App-Stores oder Programme wie gdebi (die während Debian/Ubuntu-Installationen Abhängigkeiten für Sie sammelt) mehr und mehr verwenden, anstatt Programme nach dem Herunterladen von Quellcode aus irgendeinem Mirror manuell neu zu erstellen oder dev-Seite.

Es stellt sicher, Sie alle Abhängigkeiten haben, überprüft Versionen, überprüft die Installation, testet das Laden des Paketes, Schritte zur Fehlerbehebung automatisiert usw.

+1

Kannst du erklären warum/wie das hilft? –

+0

@BenBolker Sicher, zusätzlich zu nur, weil es für mich funktioniert, verwendet es einen Paket-Manager, um die Paketinstallation zu verwalten, anstatt zu versuchen, etwas manuell zu installieren. Der gleiche Grund, warum Leute App-Stores mehr und mehr benutzen, anstatt Programme manuell zu erstellen (im Prinzip). Ich muss dazu sagen, dass 'pacman' neben dem Speichern von Eingaben eine Million Mal gespart hat und so viele Paketinstallationsfragen zu SO gelöst hat. Es stellt sicher, dass Sie alle Abhängigkeiten haben, überprüft die Installation, testet das Laden des Pakets, hat automatische Fehlerbehebungsschritte, etc. –

+0

Es scheint immer noch nicht so viel zu geben, außer "install_packages()" zu verpacken ... aber dann Das ist eine Frage des Geschmacks. –

2

Nach this post, Sie „überprüfen sollten, wenn Sie stellte alle Funktionen des numerischen Typs der xgb.DMatrix-Funktion zur Verfügung, "wenn Sie diesen Fehler sehen. Das Problem für mich gelöst.

+0

Im Idealfall könnte dies in der richtigen Fehlermeldung behandelt werden, aber bis es kommt, ist dies der wahrscheinlichste Grund für diese Fehlermeldung (als gefürchtetes C Kompilierungsproblem) – abhiieor

Verwandte Themen