cstjean / ScikitLearn.jl

Julia implementation of the scikit-learn API https://cstjean.github.io/ScikitLearn.jl/dev/
Other
544 stars 76 forks source link

Error in `@sk_import datasets` #129

Open Vilin97 opened 5 months ago

Vilin97 commented 5 months ago

The code I try to run:

using ScikitLearn # no error
@sk_import datasets: (make_circles, make_moons, make_blobs) # Error

Error stacktrace:

[ Info: Running `conda install -y -c anaconda conda` in root environment
Channels:
 - anaconda
 - conda-forge
Platform: linux-64
Collecting package metadata (repodata.json): done
Solving environment: done

==> WARNING: A newer version of conda exists. <==
    current version: 24.3.0
    latest version: 24.5.0

Please update conda by running

    $ conda update -n base -c conda-forge conda

# All requested packages already installed.

[ Info: Running `conda install -y -c conda-forge libstdcxx-ngnothing` in root environment
Channels:
 - conda-forge
Platform: linux-64
Collecting package metadata (repodata.json): done
Solving environment: failed

PackagesNotFoundError: The following packages are not available from current channels:

  - libstdcxx-ngnothing

Current channels:

  - https://conda.anaconda.org/conda-forge

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.

[ Info: scikit-learn isn't properly installed.Please make sure PyCall is using the default Conda or non-conda local python.
ERROR: failed process: Process(setenv(`/home/vilin/.julia/conda/3/x86_64/bin/conda install -y -c conda-forge libstdcxx-ngnothing`,["PATH=/home/vilin/.vscode-server/bin/8b3775030ed1a69b13e4f4c628c612102e30a681/bin/remote-cli:/home/vilin/.elan/bin:/home/vilin/.local/bin:/home/vilin/.juliaup/bin:/home/vilin/julia-1.9.0/bin:/home/vilin/anaconda3/bin:/usr/local/texlive/2023/bin/x86_64-linux:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin", "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/2474/bus", "MANPATH=/usr/bin/local/texlive/2023/texmf-dist/doc/man:", "OPENBLAS_DEFAULT_NUM_THREADS=1", "USER=vilin", "JULIA_EDITOR=code", "LESSCLOSE=/usr/bin/lesspipe %s %s", "MATHEMATICA_HOME=/home/mathematica", "XDG_DATA_DIRS=/usr/local/share:/usr/share:/var/lib/snapd/desktop", "LESSOPEN=| /usr/bin/lesspipe %s"  …  "GRDIR=/home/vilin/.julia/artifacts/2118fab1644a0abb3dd43fb741c68b42e8a92505", "TERM_PROGRAM=vscode", "VSCODE_GIT_ASKPASS_MAIN=/home/vilin/.vscode-server/bin/8b3775030ed1a69b13e4f4c628c612102e30a681/extensions/git/dist/askpass-main.js", "SSH_CONNECTION=71.212.7.86 55462 128.95.224.237 22", "MAIL=/var/mail/vilin", "FONTCONFIG_PATH=/home/vilin/.julia/artifacts/558980a93131f08be5335521b84e137ee3172296/etc/fonts", "CONDA_PREFIX=/home/vilin/.julia/conda/3/x86_64", "XDG_SESSION_ID=1912", "OPENBLAS_MAIN_FREE=1", "LS_COLORS="]), ProcessExited(1)) [1]

Stacktrace:
 [1] pipeline_error
   @ ./process.jl:598 [inlined]
 [2] run(::Cmd; wait::Bool)
   @ Base ./process.jl:513
 [3] run
   @ ./process.jl:510 [inlined]
 [4] runconda(args::Cmd, env::String)
   @ Conda ~/.julia/packages/Conda/sDjAP/src/Conda.jl:182
 [5] add(pkg::String, env::String; channel::String, satisfied_skip_solve::Bool, args::Cmd)
   @ Conda ~/.julia/packages/Conda/sDjAP/src/Conda.jl:343
 [6] add
   @ ~/.julia/packages/Conda/sDjAP/src/Conda.jl:326 [inlined]
 [7] import_sklearn()
   @ ScikitLearn.Skcore ~/.julia/packages/ScikitLearn/sqLdT/src/Skcore.jl:208
 [8] macro expansion
   @ ~/.julia/packages/ScikitLearn/sqLdT/src/Skcore.jl:272 [inlined]
 [9] top-level scope
   @ ~/GradientFlows.jl/scripts/sample.jl:67

Version info:

(@v1.11) pkg> st ScikitLearn
Status `~/.julia/environments/v1.11/Project.toml`
  [3646fa90] ScikitLearn v0.7.0

julia> versioninfo()
Julia Version 1.11.0-beta1
Commit 08e1fc0abb9 (2024-04-10 08:40 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 80 × Intel(R) Xeon(R) CPU E5-2698 v4 @ 2.20GHz
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, broadwell)
Threads: 10 default, 0 interactive, 5 GC (on 80 virtual cores)
Environment:
  JULIA_EDITOR = code
  JULIA_NUM_THREADS = 10
cstjean commented 5 months ago

conda install -y -c conda-forge libstdcxx-ngnothing

Sounds like this is the problem, and it looks unrelated to ScikitLearn. Sorry, I cannot help, but I would try posting it to Conda.jl or discourse.

tylerjthomas9 commented 5 months ago

I think this is related to https://github.com/cstjean/ScikitLearn.jl/pull/126. Does installing ScikitLearn.jl from the master branch fix this?

It may be worth removing this patch because the latest Julia versions (1.8.3+) work with scikit-learn v1.2+.

The patch was introduced here: https://github.com/cstjean/ScikitLearn.jl/pull/118

cstjean commented 5 months ago

@Vilin97 To be clear: please try ]add ScikitLearn#master and rerun your code to see if it solves the error.

Vilin97 commented 5 months ago

Now I get a segfault, @cstjean

(@v1.11) pkg> add ScikitLearn#master
     Cloning git-repo `https://github.com/cstjean/ScikitLearn.jl.git`
    Updating git-repo `https://github.com/cstjean/ScikitLearn.jl.git`
    Updating registry at `~/.julia/registries/General.toml`
   Resolving package versions...
Precompiling CUDA_Driver_jll...
  1 dependency successfully precompiled in 3 seconds. 30 already precompiled.
Precompiling CUDA_Runtime_jll...
  1 dependency successfully precompiled in 3 seconds. 31 already precompiled.
    Updating `~/.julia/environments/v1.11/Project.toml`
  [3646fa90] ~ ScikitLearn v0.7.0 ⇒ v0.7.0 `https://github.com/cstjean/ScikitLearn.jl.git#master`
    Updating `~/.julia/environments/v1.11/Manifest.toml`
  [3646fa90] ~ ScikitLearn v0.7.0 ⇒ v0.7.0 `https://github.com/cstjean/ScikitLearn.jl.git#master`
Precompiling project...
  27 dependencies successfully precompiled in 152 seconds. 453 already precompiled.

julia> using ScikitLearn

julia> @sk_import datasets: (make_circles, make_moons, make_blobs) # Error

[11952] signal 11 (1): Segmentation fault
in expression starting at REPL[4]:1
_Z10call_thunkcPKcPFxiiPPvEP7_object at /usr/local/lib/python3.6/dist-packages/scipy/sparse/_sparsetools.cpython-36m-x86_64-linux-gnu.so (unknown line)
Allocations: 28198171 (Pool: 28194033; Big: 4138); GC: 25
Segmentation fault (core dumped)

(@v1.11) pkg> st ScikitLearn
Status `~/.julia/environments/v1.11/Project.toml`
  [3646fa90] ScikitLearn v0.7.0 `https://github.com/cstjean/ScikitLearn.jl.git#master`
cstjean commented 5 months ago

Do you get the same problems on Julia 1.10?