dmlc / XGBoost.jl

XGBoost Julia Package
Other
289 stars 110 forks source link

Tests not passing on mac #63

Closed ViralBShah closed 5 years ago

ViralBShah commented 5 years ago

I am using the current tagged version of XGBoost.jl (0.3.1) on a mac with Julia 1.1.0 official binaries. The tests do not pass for me.

julia> Pkg.test("XGBoost")
   Testing XGBoost
    Status `/var/folders/rj/njz8jnv11637flz6vgnb6bz00000gp/T/tmpSvYwmb/Manifest.toml`
  [9e28174c] BinDeps v0.8.10
  [34da2185] Compat v2.1.0
  [30578b45] URIParser v0.4.0
  [009559a3] XGBoost v0.3.1
  [2a0f44e3] Base64  [`@stdlib/Base64`]
  [ade2ca70] Dates  [`@stdlib/Dates`]
  [8bb1440f] DelimitedFiles  [`@stdlib/DelimitedFiles`]
  [8ba89e20] Distributed  [`@stdlib/Distributed`]
  [b77e0a4c] InteractiveUtils  [`@stdlib/InteractiveUtils`]
  [76f85450] LibGit2  [`@stdlib/LibGit2`]
  [8f399da3] Libdl  [`@stdlib/Libdl`]
  [37e2e46d] LinearAlgebra  [`@stdlib/LinearAlgebra`]
  [56ddb016] Logging  [`@stdlib/Logging`]
  [d6f4376e] Markdown  [`@stdlib/Markdown`]
  [a63ad114] Mmap  [`@stdlib/Mmap`]
  [44cfe95a] Pkg  [`@stdlib/Pkg`]
  [de0858da] Printf  [`@stdlib/Printf`]
  [3fa0cd96] REPL  [`@stdlib/REPL`]
  [9a3f8284] Random  [`@stdlib/Random`]
  [ea8e919c] SHA  [`@stdlib/SHA`]
  [9e88b42a] Serialization  [`@stdlib/Serialization`]
  [1a1011a3] SharedArrays  [`@stdlib/SharedArrays`]
  [6462fe0b] Sockets  [`@stdlib/Sockets`]
  [2f01184e] SparseArrays  [`@stdlib/SparseArrays`]
  [10745b16] Statistics  [`@stdlib/Statistics`]
  [8dfed614] Test  [`@stdlib/Test`]
  [cf7118a7] UUIDs  [`@stdlib/UUIDs`]
  [4ec0a83e] Unicode  [`@stdlib/Unicode`]
[10:38:56] 6513x126 matrix with 143286 entries loaded from ../data/agaricus.txt.train
[10:38:57] 6513x126 matrix with 143286 entries loaded from ../data/agaricus.txt.train
[10:38:57] 1611x126 matrix with 35442 entries loaded from ../data/agaricus.txt.test
[10:38:58] 6513x126 matrix with 143286 entries loaded from ../data/agaricus.txt.train
[10:38:58] 1611x126 matrix with 35442 entries loaded from ../data/agaricus.txt.test
[1] cv-test-error:0.046522+0.002437 cv-train-error:0.046522+0.001219
[2] cv-test-error:0.022263+0.000704 cv-train-error:0.022263+0.000352
[3] cv-test-error:0.010287+0.004705 cv-train-error:0.009520+0.004733
[4] cv-test-error:0.015200+0.000461 cv-train-error:0.015200+0.000231
[5] cv-test-error:0.005834+0.003135 cv-train-error:0.004760+0.003541
[10:38:59] 6513x126 matrix with 143286 entries loaded from ../data/agaricus.txt.train
[10:38:59] 1611x126 matrix with 35442 entries loaded from ../data/agaricus.txt.test
training xgboost with dense matrix
[1] train-error:0.046522
[2] train-error:0.022263
training xgboost with sparse matrix
[1] train-error:0.046522
[2] train-error:0.022263
training xgboost with DMatrix[1]    train-error:0.000614
[2] train-error:0.000000
[10:39:00] 6513x126 matrix with 143286 entries loaded from ../data/agaricus.txt.train
[1] train-error:0.046522
[2] train-error:0.022263
test-error=0.48168839230291743
Example: Error During Test at /Users/viral/.julia/packages/XGBoost/udvqz/test/runtests.jl:78
  Got exception outside of a @test
  LoadError: Call to XGBoost C function XGBoosterSaveModel failed: [10:39:00] src/io/local_filesys.cc:209: Check failed: allow_null  LocalFileSystem::Open "xgb.model": Permission denied

  Stack trace returned 10 entries:
  [bt] (0) 0   libxgboost.dylib                    0x000000012362fdcc dmlc::StackTrace(unsigned long) + 460
  [bt] (1) 1   libxgboost.dylib                    0x000000012362fab4 dmlc::LogMessageFatal::~LogMessageFatal() + 52
  [bt] (2) 2   libxgboost.dylib                    0x00000001237095cd dmlc::io::LocalFileSystem::Open(dmlc::io::URI const&, char const*, bool) + 1069
  [bt] (3) 3   libxgboost.dylib                    0x00000001237011a1 dmlc::Stream::Create(char const*, char const*, bool) + 65
  [bt] (4) 4   libxgboost.dylib                    0x000000012364a496 XGBoosterSaveModel + 118
  [bt] (5) 5   ???                                 0x0000000123200166 0x0 + 4884267366
  [bt] (6) 6   ???                                 0x00000001232000cb 0x0 + 4884267211
  [bt] (7) 7   libjulia.1.1.dylib                  0x0000000109bc6798 do_call + 200
  [bt] (8) 8   libjulia.1.1.dylib                  0x0000000109bc5275 eval_body + 1333
  [bt] (9) 9   libjulia.1.1.dylib                  0x0000000109bc5788 jl_interpret_toplevel_thunk_callback + 408

  Stacktrace:
   [1] error(::String, ::String, ::String, ::String) at ./error.jl:42
   [2] XGBoosterSaveModel(::Ptr{Nothing}, ::String) at /Users/viral/.julia/packages/XGBoost/udvqz/src/xgboost_wrapper_h.jl:17
   [3] save(::Booster, ::String) at /Users/viral/.julia/packages/XGBoost/udvqz/src/xgboost_lib.jl:111
   [4] top-level scope at none:0
   [5] include at ./boot.jl:326 [inlined]
   [6] include_relative(::Module, ::String) at ./loading.jl:1038
   [7] include(::Module, ::String) at ./sysimg.jl:29
   [8] include(::String) at ./client.jl:403
   [9] top-level scope at /Users/viral/.julia/packages/XGBoost/udvqz/test/runtests.jl:79
   [10] top-level scope at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Test/src/Test.jl:1083
   [11] top-level scope at /Users/viral/.julia/packages/XGBoost/udvqz/test/runtests.jl:79
   [12] top-level scope at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Test/src/Test.jl:1083
   [13] top-level scope at /Users/viral/.julia/packages/XGBoost/udvqz/test/runtests.jl:10
   [14] include at ./boot.jl:326 [inlined]
   [15] include_relative(::Module, ::String) at ./loading.jl:1038
   [16] include(::Module, ::String) at ./sysimg.jl:29
   [17] include(::String) at ./client.jl:403
   [18] top-level scope at none:0
   [19] eval(::Module, ::Any) at ./boot.jl:328
   [20] exec_options(::Base.JLOptions) at ./client.jl:243
   [21] _start() at ./client.jl:436
  in expression starting at /Users/viral/.julia/packages/XGBoost/udvqz/test/example.jl:52
Test Summary:        | Pass  Error  Total
XGBoost              |    6      1      7
  Sparse matrices    |              No tests
  DMatrix loading    |    2             2
  Agaricus training  |    3             3
  Cross validation   |              No tests
  Feature importance |    1             1
  Example            |           1      1
ERROR: LoadError: Some tests did not pass: 6 passed, 0 failed, 1 errored, 0 broken.
in expression starting at /Users/viral/.julia/packages/XGBoost/udvqz/test/runtests.jl:8
ERROR: Package XGBoost errored during testing
Stacktrace:
 [1] pkgerror(::String, ::Vararg{String,N} where N) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Pkg/src/Types.jl:120
 [2] #test#66(::Bool, ::Function, ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Pkg/src/Operations.jl:1328
 [3] #test at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:0 [inlined]
 [4] #test#44(::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:193
 [5] test at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:178 [inlined]
 [6] #test#43 at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:175 [inlined]
 [7] test at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:175 [inlined]
 [8] #test#42 at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:174 [inlined]
 [9] test at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:174 [inlined]
 [10] #test#41(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::String) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:173
 [11] test(::String) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:173
 [12] top-level scope at none:0
ViralBShah commented 5 years ago

The reason the tests are not passing is because the example.jl test tries to write to xgb.model and the *.txt files in the test directory. The files had permissions -r--r--r--. Fixing the permissions made the tests pass.

aviks commented 5 years ago

Seems OK for me now.