Code Monkey home page Code Monkey logo

pycalljld.jl's People

Contributors

cstjean avatar juliatagbot avatar kavir1698 avatar okonsamuel avatar staticfloat avatar stevengj avatar ymtoo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pycalljld.jl's Issues

`ERROR: LoadError: type DataType has no field mutable`

I'm having a similar issue to #18 while saving PyObject arrays. I have seen that in that issue they mention than deleting the environment solved it. I would very much like to avoid that, since messing with conda environments is always dangerous.

I'm just doing:

JLD.save(joinpath(ODINN.root_dir, "test/data/gdirs.jld"), "gdirs", gdirs)

Is this normal? What is the issue here?

With python 3.6 cPickle cannot be found, instead one have to import pickle

Hello, I cannot precompile the module when using python 3.6 because it cannot found the cPickle module.
Here is the error code:

ERROR: LoadError: InitError: PyError (ccall(@pysym(:PyImport_ImportModule), PyPtr, (Cstring,), name)) <class 'ModuleNotFoundError'>
ModuleNotFoundError("No module named 'cPickle'",)

Stacktrace:
 [1] pyerr_check at /home/gluon/.julia/v0.6/PyCall/src/exception.jl:56 [inlined]
 [2] pyerr_check at /home/gluon/.julia/v0.6/PyCall/src/exception.jl:61 [inlined]
 [3] macro expansion at /home/gluon/.julia/v0.6/PyCall/src/exception.jl:81 [inlined]
 [4] pyimport(::String) at /home/gluon/.julia/v0.6/PyCall/src/PyCall.jl:374
 [5] __init__() at /home/gluon/.julia/v0.6/PyCallJLD/src/PyCallJLD.jl:11
 [6] _include_from_serialized(::String) at ./loading.jl:157
 [7] _require_from_serialized(::Int64, ::Symbol, ::String, ::Bool) at ./loading.jl:200
 [8] _require_search_from_serialized(::Int64, ::Symbol, ::String, ::Bool) at ./loading.jl:236
 [9] _require(::Symbol) at ./loading.jl:441
 [10] require(::Symbol) at ./loading.jl:405
 [11] include_from_node1(::String) at ./loading.jl:576
 [12] include(::String) at ./sysimg.jl:14
 [13] anonymous at ./<missing>:2
during initialization of module PyCallJLD

I have searched across the internet and found that for python 3.x one has to import pickle and it will fall down to cPickle when possible.
Indeed changing the import function in PyCallJLD.jl to pickle allows to compile probably. Any Chance to have it in the version installed by Pkg?

`ERROR: LoadError: type DataType has no field mutable` while trying to save a ScikitLearn model

┌ Warning: JLD incorrectly extends FileIO functions (see FileIO documentation)
└ @ FileIO ~/.julia/packages/FileIO/u9YLx/src/loadsave.jl:217
Error encountered while save File{DataFormat{:JLD}, String}("saved_file.jld").

Fatal error:
ERROR: LoadError: type DataType has no field mutable
Stacktrace:
  [1] getproperty
    @ ./Base.jl:37 [inlined]
  [2] write_ref(parent::JLD.JldFile, data::Vector{UInt8}, wsession::JLD.JldWriteSession)
    @ JLD ~/.julia/packages/JLD/jeGJb/src/JLD.jl:673
  [3] macro expansion
    @ ~/.julia/packages/JLD/jeGJb/src/jld_types.jl:639 [inlined]
  [4] h5convert!(out::Ptr{UInt8}, file::JLD.JldFile, x::PyCallJLD.PyObjectSerialization, wsession::JLD.JldWriteSession)
    @ JLD ~/.julia/packages/JLD/jeGJb/src/jld_types.jl:654
  [5] write_compound(parent::JLD.JldFile, name::String, s::PyCallJLD.PyObjectSerialization, wsession::JLD.JldWriteSession; kargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ JLD ~/.julia/packages/JLD/jeGJb/src/JLD.jl:710
  [6] write_compound
    @ ~/.julia/packages/JLD/jeGJb/src/JLD.jl:704 [inlined]
  [7] #_write#23
    @ ~/.julia/packages/JLD/jeGJb/src/JLD.jl:700 [inlined]
  [8] _write
    @ ~/.julia/packages/JLD/jeGJb/src/JLD.jl:700 [inlined]
  [9] #write#17
    @ ~/.julia/packages/JLD/jeGJb/src/JLD.jl:524 [inlined]
 [10] write
    @ ~/.julia/packages/JLD/jeGJb/src/JLD.jl:524 [inlined]
 [11] (::JLD.var"#41#42"{String, PyObject, Tuple{}})(file::JLD.JldFile)
    @ JLD ~/.julia/packages/JLD/jeGJb/src/JLD.jl:1235
 [12] jldopen(::JLD.var"#41#42"{String, PyObject, Tuple{}}, ::String, ::Vararg{String}; kws::Base.Pairs{Symbol, Bool, Tuple{Symbol, Symbol}, NamedTuple{(:compatible, :compress), Tuple{Bool, Bool}}})
    @ JLD ~/.julia/packages/JLD/jeGJb/src/JLD.jl:243
 [13] #save#40
    @ ~/.julia/packages/JLD/jeGJb/src/JLD.jl:1233 [inlined]
 [14] save(::File{DataFormat{:JLD}, String}, ::String, ::PyObject)
    @ JLD ~/.julia/packages/JLD/jeGJb/src/JLD.jl:1230
 [15] invokelatest(::Any, ::Any, ::Vararg{Any}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Base ./essentials.jl:716
 [16] invokelatest(::Any, ::Any, ::Vararg{Any})
    @ Base ./essentials.jl:714
 [17] action(::Symbol, ::Vector{Union{Base.PkgId, Module}}, ::Formatted, ::String, ::Vararg{Any}; options::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ FileIO ~/.julia/packages/FileIO/u9YLx/src/loadsave.jl:219
 [18] action(::Symbol, ::Vector{Union{Base.PkgId, Module}}, ::Formatted, ::String, ::PyObject)
    @ FileIO ~/.julia/packages/FileIO/u9YLx/src/loadsave.jl:197
 [19] action(::Symbol, ::Vector{Union{Base.PkgId, Module}}, ::Symbol, ::String, ::String, ::Vararg{Any}; options::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ FileIO ~/.julia/packages/FileIO/u9YLx/src/loadsave.jl:185
 [20] action
    @ ~/.julia/packages/FileIO/u9YLx/src/loadsave.jl:185 [inlined]
 [21] #save#20
    @ ~/.julia/packages/FileIO/u9YLx/src/loadsave.jl:129 [inlined]
 [22] save(::String, ::String, ::PyObject)
    @ FileIO ~/.julia/packages/FileIO/u9YLx/src/loadsave.jl:126
 [23] top-level scope
    @ ~/Documents/CODE/CompModelCode/lab2.jl:38
Stacktrace:
 [1] handle_error(e::ErrorException, q::Base.PkgId, bt::Vector{Union{Ptr{Nothing}, Base.InterpreterIP}})
   @ FileIO ~/.julia/packages/FileIO/u9YLx/src/error_handling.jl:61
 [2] handle_exceptions(exceptions::Vector{Tuple{Any, Union{Base.PkgId, Module}, Vector}}, action::String)
   @ FileIO ~/.julia/packages/FileIO/u9YLx/src/error_handling.jl:56
 [3] action(::Symbol, ::Vector{Union{Base.PkgId, Module}}, ::Formatted, ::String, ::Vararg{Any}; options::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ FileIO ~/.julia/packages/FileIO/u9YLx/src/loadsave.jl:228
 [4] action(::Symbol, ::Vector{Union{Base.PkgId, Module}}, ::Formatted, ::String, ::PyObject)
   @ FileIO ~/.julia/packages/FileIO/u9YLx/src/loadsave.jl:197
 [5] action(::Symbol, ::Vector{Union{Base.PkgId, Module}}, ::Symbol, ::String, ::String, ::Vararg{Any}; options::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ FileIO ~/.julia/packages/FileIO/u9YLx/src/loadsave.jl:185
 [6] action
   @ ~/.julia/packages/FileIO/u9YLx/src/loadsave.jl:185 [inlined]
 [7] #save#20
   @ ~/.julia/packages/FileIO/u9YLx/src/loadsave.jl:129 [inlined]
 [8] save(::String, ::String, ::PyObject)
   @ FileIO ~/.julia/packages/FileIO/u9YLx/src/loadsave.jl:126
 [9] top-level scope
   @ ~/Documents/CODE/CompModelCode/lab2.jl:38```

pycall api updates

PyCall 1.90.0 is now released, which change o[:foo] and o["foo"] to o.foo and o."foo", respectively, for python objects o; see also JuliaPy/PyCall.jl#629.

The old getindex methods still work but are deprecated, so you'll want to put out a new release that uses the new methods and REQUIREs PyCall 1.90.0 to avoid having zillions of deprecation messages.

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

Cannot save pydef-defined class

@pydef type Store
    __init__(self, a) = (self[:a] = a)
end
save("dummy.jld", "x", Store(10))
> PyError (ccall(@pysym(:PyObject_Call), PyPtr, (PyPtr, PyPtr, PyPtr), o, arg, C_NULL)) <class 'cPickle.PicklingError'>
> PicklingError("Can't pickle <class 'Store'>: attribute lookup __main__.Store failed",)

I don't think anything can be done about it, though.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.