Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't load KMeans from ParallelKMeans #740

Closed
simonschoelly opened this issue Feb 9, 2021 · 6 comments
Closed

Can't load KMeans from ParallelKMeans #740

simonschoelly opened this issue Feb 9, 2021 · 6 comments

Comments

@simonschoelly
Copy link

Describe the bug

Loading KMeans from the ParallelKMeans.jl does not work even though that model is listed when calling models() with the entry (name = KMeans, package_name = ParallelKMeans, ... ).

To Reproduce

import MLJ

KMeans = MLJ.@load KMeans pkg=ParallelKMeans

output:

┌ Info: For silent loading, specify `verbosity=0`. 
└ @ Main /home/simon/.julia/packages/MLJModels/66QJr/src/loading.jl:168

import ParallelKMeans ✔

UndefVarError: KMeans not defined

Stacktrace:
 [1] eval
   @ ./boot.jl:360 [inlined]
 [2] eval(x::Expr)
   @ Base.MainInclude ./client.jl:446
 [3] _eval(modl::Module, path::Expr)
   @ MLJModels ~/.julia/packages/MLJModels/66QJr/src/loading.jl:40
 [4] top-level scope
   @ ~/.julia/packages/MLJModels/66QJr/src/loading.jl:207
 [5] eval
   @ ./boot.jl:360 [inlined]
 [6] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
   @ Base ./loading.jl:1090

Expected behavior

A constructor for a KMeans model should be loaded.

Additional context

Doing the same with pkg=Clustering works.

Versions

MLJ v0.16.0
MLJClusteringInterface v0.1.3
ParallelKMeans v0.1.0
Julia: 1.6.0-beta1

No output when running using MLJ

@ablaom
Copy link
Member

ablaom commented Feb 9, 2021

Thanks for reporting!

It's possible this will be resolved by:

Still, this should not have happened. Can you please post the output of

using Pkg
Pkg.status()

and

Pkg.status(mode=PKGMODE_MANIFEST)

@simonschoelly
Copy link
Author

julia> using Pkg; Pkg.status()
Status `~/Projects/julia-machine-learning/Project.toml`
  [aaaa29a8] Clustering v0.14.2
  [a93c6f00] DataFrames v0.22.5
  [b4f34e82] Distances v0.10.2
  [a09fc81d] ImageCore v0.8.20
  [add582a8] MLJ v0.16.0
  [d354fa79] MLJClusteringInterface v0.1.3
  [5ae90465] MLJScikitLearnInterface v0.1.8
  [8b842266] PalmerPenguins v0.1.1
  [42b8e9d4] ParallelKMeans v0.1.0
  [91a5bcdd] Plots v1.10.3
  [3646fa90] ScikitLearn v0.6.3
  [10745b16] Statistics

julia> Pkg.status(mode=PKGMODE_MANIFEST)
Status `~/Projects/julia-machine-learning/Manifest.toml`
  [621f4979] AbstractFFTs v1.0.0
  [79e6a3ab] Adapt v3.2.0
  [fbb218c0] BSON v0.2.6
  [b99e7846] BinaryProvider v0.5.10
  [336ed68f] CSV v0.7.10
  [324d7699] CategoricalArrays v0.8.3
  [d360d2e6] ChainRulesCore v0.9.28
  [aaaa29a8] Clustering v0.14.2
  [944b1d66] CodecZlib v0.7.0
  [35d6a980] ColorSchemes v3.10.2
  [3da002f7] ColorTypes v0.10.9
  [5ae59095] Colors v0.12.6
  [34da2185] Compat v3.25.0
  [ed09eef8] ComputationalResources v0.3.2
  [8f4d0f93] Conda v1.5.0
  [d38c429a] Contour v0.5.7
  [a8cc5b0e] Crayons v4.0.4
  [9a962f9c] DataAPI v1.5.1
  [124859b0] DataDeps v0.7.7
  [a93c6f00] DataFrames v0.22.5
  [864edb3b] DataStructures v0.18.9
  [e2d170a0] DataValueInterfaces v1.0.0
  [b4f34e82] Distances v0.10.2
  [31c24e10] Distributions v0.24.12
  [e2ba6199] ExprTools v0.1.3
  [8f5d6c58] EzXML v1.1.0
  [c87230d0] FFMPEG v0.4.0
  [48062228] FilePathsBase v0.9.8
  [1a297f60] FillArrays v0.11.1
  [53c48c17] FixedPointNumbers v0.8.4
  [59287772] Formatting v0.4.2
  [28b8d3ca] GR v0.54.0
  [5c1252a2] GeometryBasics v0.3.9
  [a2bd30eb] Graphics v1.0.2
  [42e2da0e] Grisu v1.0.0
  [cd3eb016] HTTP v0.9.2
  [a09fc81d] ImageCore v0.8.20
  [83e8ac13] IniFile v0.5.0
  [41ab1584] InvertedIndices v1.0.0
  [c8e1da08] IterTools v1.3.0
  [82899510] IteratorInterfaceExtensions v1.0.0
  [692b3bcd] JLLWrappers v1.2.0
  [9da8a3cd] JLSO v2.4.0
  [682c06a0] JSON v0.21.1
  [b964fa9f] LaTeXStrings v1.2.0
  [23fbe1c1] Latexify v0.14.7
  [a5e1c1ea] LatinHypercubeSampling v1.7.3
  [7f8f8fb0] LearnBase v0.4.1
  [30fc2ffe] LossFunctions v0.6.2
  [add582a8] MLJ v0.16.0
  [a7f614a8] MLJBase v0.17.2
  [d354fa79] MLJClusteringInterface v0.1.3
  [e80e1ace] MLJModelInterface v0.4.0
  [d491faf4] MLJModels v0.14.0
  [2e2323e0] MLJScientificTypes v0.4.4
  [5ae90465] MLJScikitLearnInterface v0.1.8
  [03970b2e] MLJTuning v0.6.1
  [1914dd2f] MacroTools v0.5.6
  [dbb5928d] MappedArrays v0.3.0
  [739be429] MbedTLS v1.0.3
  [442fdcdd] Measures v0.3.1
  [f28f55f0] Memento v1.1.2
  [e1d29d7a] Missings v0.4.5
  [78c3b35d] Mocking v0.7.1
  [e94cdb99] MosaicViews v0.2.4
  [77ba4419] NaNMath v0.3.5
  [b8a86587] NearestNeighbors v0.4.8
  [6fe1bfb0] OffsetArrays v1.5.3
  [bac558e1] OrderedCollections v1.3.3
  [90014a1f] PDMats v0.10.1
  [5432bcbf] PaddedViews v0.5.8
  [8b842266] PalmerPenguins v0.1.1
  [42b8e9d4] ParallelKMeans v0.1.0
  [d96e819e] Parameters v0.12.2
  [69de0a69] Parsers v1.0.15
  [b1ad91c1] PersistenceDiagramsBase v0.1.1
  [ccf2f8ad] PlotThemes v2.0.1
  [995b91a9] PlotUtils v1.0.10
  [91a5bcdd] Plots v1.10.3
  [2dfb63ee] PooledArrays v0.5.3
  [08abe8d2] PrettyTables v0.11.0
  [92933f4c] ProgressMeter v1.4.1
  [438e738f] PyCall v1.92.2
  [1fd47b50] QuadGK v2.4.1
  [3cdcf5f2] RecipesBase v1.1.1
  [01d81517] RecipesPipeline v0.2.1
  [189a3867] Reexport v1.0.0
  [ae029012] Requires v1.1.2
  [79098fc4] Rmath v0.6.1
  [321657f4] ScientificTypes v1.1.1
  [3646fa90] ScikitLearn v0.6.3
  [6e75b9c4] ScikitLearnBase v0.5.0
  [6c6a2e73] Scratch v1.0.3
  [91c51154] SentinelArrays v1.2.16
  [992d4aef] Showoff v0.3.2
  [a2af1166] SortingAlgorithms v0.3.1
  [276daf66] SpecialFunctions v1.2.1
  [860ef19b] StableRNGs v1.0.0
  [90137ffa] StaticArrays v1.0.1
  [64bff920] StatisticalTraits v0.1.0
  [2913bbd2] StatsBase v0.33.2
  [4c63d2b9] StatsFuns v0.9.6
  [09ab397b] StructArrays v0.5.0
  [856f2bd8] StructTypes v1.2.3
  [cea106d9] Syslogs v0.3.0
  [3783bdb8] TableTraits v1.0.0
  [bd369af6] Tables v1.3.2
  [f269a46b] TimeZones v1.5.3
  [3bb67fe8] TranscodingStreams v0.9.5
  [5c2747f8] URIs v1.2.0
  [3a884ed6] UnPack v1.0.2
  [81def892] VersionParsing v1.2.0
  [6e34b625] Bzip2_jll v1.0.6+5
  [83423d85] Cairo_jll v1.16.0+6
  [5ae413db] EarCut_jll v2.1.5+1
  [2e619515] Expat_jll v2.2.7+6
  [b22a6f82] FFMPEG_jll v4.3.1+4
  [a3f928ae] Fontconfig_jll v2.13.1+14
  [d7e528f0] FreeType2_jll v2.10.1+5
  [559328eb] FriBidi_jll v1.0.5+6
  [0656b61e] GLFW_jll v3.3.2+1
  [d2c73de3] GR_jll v0.53.0+0
  [78b55507] Gettext_jll v0.20.1+7
  [7746bdde] Glib_jll v2.59.0+4
  [aacddb02] JpegTurbo_jll v2.0.1+3
  [c1c5ebd0] LAME_jll v3.100.0+3
  [dd4b983a] LZO_jll v2.10.0+3
  [dd192d2f] LibVPX_jll v1.9.0+1
  [e9f186c6] Libffi_jll v3.2.1+4
  [d4300ac3] Libgcrypt_jll v1.8.5+4
  [7e76a0d4] Libglvnd_jll v1.3.0+3
  [7add5ba3] Libgpg_error_jll v1.36.0+3
  [94ce4f54] Libiconv_jll v1.16.0+7
  [4b2f31a3] Libmount_jll v2.34.0+3
  [89763e89] Libtiff_jll v4.1.0+2
  [38a345b3] Libuuid_jll v2.34.0+7
  [e7412a2a] Ogg_jll v1.3.4+2
  [458c3c95] OpenSSL_jll v1.1.1+6
  [efe28fd5] OpenSpecFun_jll v0.5.3+4
  [91d4177d] Opus_jll v1.3.1+3
  [2f80f16e] PCRE_jll v8.42.0+4
  [30392449] Pixman_jll v0.40.0+0
  [ede63266] Qt_jll v5.15.2+1
  [f50d1b31] Rmath_jll v0.2.2+1
  [a2964d1f] Wayland_jll v1.17.0+4
  [2381bf8a] Wayland_protocols_jll v1.18.0+4
  [02c8fc9c] XML2_jll v2.9.11+0
  [aed1982a] XSLT_jll v1.1.33+4
  [4f6342f7] Xorg_libX11_jll v1.6.9+4
  [0c0b7dd1] Xorg_libXau_jll v1.0.9+4
  [935fb764] Xorg_libXcursor_jll v1.2.0+4
  [a3789734] Xorg_libXdmcp_jll v1.1.3+4
  [1082639a] Xorg_libXext_jll v1.3.4+4
  [d091e8ba] Xorg_libXfixes_jll v5.0.3+4
  [a51aa0fd] Xorg_libXi_jll v1.7.10+4
  [d1454406] Xorg_libXinerama_jll v1.1.4+4
  [ec84b674] Xorg_libXrandr_jll v1.5.2+4
  [ea2f1a96] Xorg_libXrender_jll v0.9.10+4
  [14d82f49] Xorg_libpthread_stubs_jll v0.1.0+3
  [c7cfdc94] Xorg_libxcb_jll v1.13.0+3
  [cc61e674] Xorg_libxkbfile_jll v1.1.0+4
  [12413925] Xorg_xcb_util_image_jll v0.4.0+1
  [2def613f] Xorg_xcb_util_jll v0.4.0+1
  [975044d2] Xorg_xcb_util_keysyms_jll v0.4.0+1
  [0d47668e] Xorg_xcb_util_renderutil_jll v0.3.9+1
  [c22f9ab0] Xorg_xcb_util_wm_jll v0.4.1+1
  [35661453] Xorg_xkbcomp_jll v1.4.2+4
  [33bec58e] Xorg_xkeyboard_config_jll v2.27.0+4
  [c5fb5394] Xorg_xtrans_jll v1.4.0+3
  [3161d3a3] Zstd_jll v1.4.8+0
  [0ac62f75] libass_jll v0.14.0+4
  [f638f0a6] libfdk_aac_jll v0.1.6+4
  [b53b4c65] libpng_jll v1.6.37+6
  [f27f6e37] libvorbis_jll v1.3.6+6
  [1270edf5] x264_jll v2020.7.14+2
  [dfaa095f] x265_jll v3.0.0+3
  [d8fb68d0] xkbcommon_jll v0.9.1+5
  [0dad84c5] ArgTools
  [56f22d72] Artifacts
  [2a0f44e3] Base64
  [ade2ca70] Dates
  [8bb1440f] DelimitedFiles
  [8ba89e20] Distributed
  [f43a241f] Downloads
  [9fa8497b] Future
  [b77e0a4c] InteractiveUtils
  [b27032c2] LibCURL
  [76f85450] LibGit2
  [8f399da3] Libdl
  [37e2e46d] LinearAlgebra
  [56ddb016] Logging
  [d6f4376e] Markdown
  [a63ad114] Mmap
  [ca575930] NetworkOptions
  [44cfe95a] Pkg
  [de0858da] Printf
  [3fa0cd96] REPL
  [9a3f8284] Random
  [ea8e919c] SHA
  [9e88b42a] Serialization
  [1a1011a3] SharedArrays
  [6462fe0b] Sockets
  [2f01184e] SparseArrays
  [10745b16] Statistics
  [4607b0f0] SuiteSparse
  [fa267f1f] TOML
  [a4e569a6] Tar
  [8dfed614] Test
  [cf7118a7] UUIDs
  [4ec0a83e] Unicode
  [e66e0078] CompilerSupportLibraries_jll
  [deac9b47] LibCURL_jll
  [29816b5a] LibSSH2_jll
  [c8ffd9c3] MbedTLS_jll
  [14a3606d] MozillaCACerts_jll
  [83775a58] Zlib_jll
  [8e850ede] nghttp2_jll
  [3f19e933] p7zip_jll

@PyDataBlog
Copy link

PyDataBlog commented Feb 9, 2021

Thanks for reporting!

It's possible this will be resolved by:

Still, this should not have happened. Can you please post the output of

using Pkg
Pkg.status()

and

Pkg.status(mode=PKGMODE_MANIFEST)

A fix is currently being tested with regards to issues with Julia 1.3 and ParallelKMeans. @simonschoelly, I also suggest that u always install the latest versions of the package as I can see your load preloads 0.1.0 instead of the latest version.

@ablaom
Copy link
Member

ablaom commented Feb 9, 2021

Right, here's the issue. The version of ParallelKMeans in your environment 0.1.0 pre-dates its implementation of the MLJ model interface. For this reason you are allowed to have it in the same environment as the latest version of MLJ 0.16, even though MLJ 0.16 is incompatible with every version of ParallelKMeans <= 0.1.9 that does implement the MLJ model interface.

So, indeed the compatibility update for ParallelKMeans should resolve your issue. Alternatively, you should be able to use ParallelKMeans 0.1.9 with the older MLJ version 0.15.2.

Still, the error message you received is not helpful. Closing in favour of JuliaAI/MLJModels.jl#363

@ablaom ablaom closed this as completed Feb 9, 2021
@ablaom
Copy link
Member

ablaom commented Feb 12, 2021

This should now be resolved if you update your ParallelKMeans version. Re-open if you continue to have problems.

@simonschoelly
Copy link
Author

I can confirm that it works now. Thanks for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants