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

ERROR: LoadError: type DataType has no field mutable #19

Open
JordiBolibar opened this issue Mar 24, 2022 · 6 comments
Open

ERROR: LoadError: type DataType has no field mutable #19

JordiBolibar opened this issue Mar 24, 2022 · 6 comments

Comments

@JordiBolibar
Copy link

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?

@cstjean
Copy link
Collaborator

cstjean commented Mar 24, 2022

Wish I could help, but this doesn't ring a bell at all. Maybe post the stacktrace (i.e. the full error message + what's below)?

@JordiBolibar
Copy link
Author

Sure, here's the full stacktrace:

Error encountered while save FileIO.File{FileIO.DataFormat{:JLD}, String}("/home/jovyan/Julia/fork/ODINN/test/data/gdirs.jld").

Fatal error:
ERROR: LoadError: type DataType has no field mutable
Stacktrace:
  [1] getproperty
    @ ./Base.jl:37 [inlined]
  [2] h5fieldtype(parent::JLD.JldFile, T::Any, commit::Bool)
    @ JLD /srv/julia/pkg/packages/JLD/JHrZe/src/jld_types.jl:313
  [3] _write(parent::JLD.JldFile, path::String, data::Vector{PyObject}, wsession::JLD.JldWriteSession; kargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ JLD /srv/julia/pkg/packages/JLD/JHrZe/src/JLD.jl:592
  [4] _write(parent::JLD.JldFile, path::String, data::Vector{PyObject}, wsession::JLD.JldWriteSession)
    @ JLD /srv/julia/pkg/packages/JLD/JHrZe/src/JLD.jl:591
  [5] write(parent::JLD.JldFile, name::String, data::Vector{PyObject}, wsession::JLD.JldWriteSession; kargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ JLD /srv/julia/pkg/packages/JLD/JHrZe/src/JLD.jl:542
  [6] write(parent::JLD.JldFile, name::String, data::Vector{PyObject}, wsession::JLD.JldWriteSession)
    @ JLD /srv/julia/pkg/packages/JLD/JHrZe/src/JLD.jl:542
  [7] (::JLD.var"#41#42"{String, Vector{PyObject}, Tuple{}})(file::JLD.JldFile)
    @ JLD /srv/julia/pkg/packages/JLD/JHrZe/src/JLD.jl:1260
  [8] jldopen(::JLD.var"#41#42"{String, Vector{PyObject}, Tuple{}}, ::String, ::Vararg{String}; kws::Base.Pairs{Symbol, Bool, Tuple{Symbol, Symbol}, NamedTuple{(:compatible, :compress), Tuple{Bool, Bool}}})
    @ JLD /srv/julia/pkg/packages/JLD/JHrZe/src/JLD.jl:261
  [9] fileio_save(::FileIO.File{FileIO.DataFormat{:JLD}, String}, ::String, ::Vector{PyObject}; compatible::Bool, compress::Bool)
    @ JLD /srv/julia/pkg/packages/JLD/JHrZe/src/JLD.jl:1258
 [10] fileio_save(::FileIO.File{FileIO.DataFormat{:JLD}, String}, ::String, ::Vector{PyObject})
    @ JLD /srv/julia/pkg/packages/JLD/JHrZe/src/JLD.jl:1255
 [11] invokelatest(::Any, ::Any, ::Vararg{Any}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Base ./essentials.jl:716
 [12] invokelatest(::Any, ::Any, ::Vararg{Any})
    @ Base ./essentials.jl:714
 [13] action(::Symbol, ::Vector{Union{Base.PkgId, Module}}, ::FileIO.Formatted, ::String, ::Vararg{Any}; options::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ FileIO /srv/julia/pkg/packages/FileIO/u9YLx/src/loadsave.jl:219
 [14] action(::Symbol, ::Vector{Union{Base.PkgId, Module}}, ::FileIO.Formatted, ::String, ::Vector{PyObject})
    @ FileIO /srv/julia/pkg/packages/FileIO/u9YLx/src/loadsave.jl:197
 [15] action(::Symbol, ::Vector{Union{Base.PkgId, Module}}, ::Symbol, ::String, ::String, ::Vararg{Any}; options::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ FileIO /srv/julia/pkg/packages/FileIO/u9YLx/src/loadsave.jl:185
 [16] action
    @ /srv/julia/pkg/packages/FileIO/u9YLx/src/loadsave.jl:185 [inlined]
 [17] #save#20
    @ /srv/julia/pkg/packages/FileIO/u9YLx/src/loadsave.jl:129 [inlined]
 [18] save(::String, ::String, ::Vector{PyObject})
    @ FileIO /srv/julia/pkg/packages/FileIO/u9YLx/src/loadsave.jl:126
 [19] run()
    @ Main ~/Julia/fork/ODINN/src/scripts/toy_model.jl:45
 [20] top-level scope
    @ ~/Julia/fork/ODINN/src/scripts/toy_model.jl:120
Stacktrace:
  [1] handle_error(e::ErrorException, q::Base.PkgId, bt::Vector{Union{Ptr{Nothing}, Base.InterpreterIP}})
    @ FileIO /srv/julia/pkg/packages/FileIO/u9YLx/src/error_handling.jl:61
  [2] handle_exceptions(exceptions::Vector{Tuple{Any, Union{Base.PkgId, Module}, Vector}}, action::String)
    @ FileIO /srv/julia/pkg/packages/FileIO/u9YLx/src/error_handling.jl:56
  [3] action(::Symbol, ::Vector{Union{Base.PkgId, Module}}, ::FileIO.Formatted, ::String, ::Vararg{Any}; options::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ FileIO /srv/julia/pkg/packages/FileIO/u9YLx/src/loadsave.jl:228
  [4] action(::Symbol, ::Vector{Union{Base.PkgId, Module}}, ::FileIO.Formatted, ::String, ::Vector{PyObject})
    @ FileIO /srv/julia/pkg/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 /srv/julia/pkg/packages/FileIO/u9YLx/src/loadsave.jl:185
  [6] action
    @ /srv/julia/pkg/packages/FileIO/u9YLx/src/loadsave.jl:185 [inlined]
  [7] #save#20
    @ /srv/julia/pkg/packages/FileIO/u9YLx/src/loadsave.jl:129 [inlined]
  [8] save(::String, ::String, ::Vector{PyObject})
    @ FileIO /srv/julia/pkg/packages/FileIO/u9YLx/src/loadsave.jl:126
  [9] run()
    @ Main ~/Julia/fork/ODINN/src/scripts/toy_model.jl:45
 [10] top-level scope
    @ ~/Julia/fork/ODINN/src/scripts/toy_model.jl:120
in expression starting at /home/jovyan/Julia/fork/ODINN/src/scripts/toy_model.jl:120

@cstjean
Copy link
Collaborator

cstjean commented Mar 24, 2022

gdirs seems to be a Vector{PyObject}. What happens if you try to save just gdirs[1]?

@JordiBolibar
Copy link
Author

I get the same error:

Error encountered while save FileIO.File{FileIO.DataFormat{:JLD}, String}("/home/jovyan/Julia/fork/ODINN/test/data/gdirs.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 /srv/julia/pkg/packages/JLD/JHrZe/src/JLD.jl:696
  [3] macro expansion
    @ /srv/julia/pkg/packages/JLD/JHrZe/src/jld_types.jl:639 [inlined]
  [4] h5convert!(out::Ptr{UInt8}, file::JLD.JldFile, x::PyCallJLD.PyObjectSerialization, wsession::JLD.JldWriteSession)
    @ JLD /srv/julia/pkg/packages/JLD/JHrZe/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 /srv/julia/pkg/packages/JLD/JHrZe/src/JLD.jl:733
  [6] write_compound
    @ /srv/julia/pkg/packages/JLD/JHrZe/src/JLD.jl:727 [inlined]
  [7] #_write#23
    @ /srv/julia/pkg/packages/JLD/JHrZe/src/JLD.jl:723 [inlined]
  [8] _write
    @ /srv/julia/pkg/packages/JLD/JHrZe/src/JLD.jl:723 [inlined]
  [9] #write#17
    @ /srv/julia/pkg/packages/JLD/JHrZe/src/JLD.jl:542 [inlined]
 [10] write
    @ /srv/julia/pkg/packages/JLD/JHrZe/src/JLD.jl:542 [inlined]
 [11] (::JLD.var"#41#42"{String, PyObject, Tuple{}})(file::JLD.JldFile)
    @ JLD /srv/julia/pkg/packages/JLD/JHrZe/src/JLD.jl:1260
 [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 /srv/julia/pkg/packages/JLD/JHrZe/src/JLD.jl:261
 [13] #fileio_save#40
    @ /srv/julia/pkg/packages/JLD/JHrZe/src/JLD.jl:1258 [inlined]
 [14] fileio_save(::FileIO.File{FileIO.DataFormat{:JLD}, String}, ::String, ::PyObject)
    @ JLD /srv/julia/pkg/packages/JLD/JHrZe/src/JLD.jl:1255
 [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}}, ::FileIO.Formatted, ::String, ::Vararg{Any}; options::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ FileIO /srv/julia/pkg/packages/FileIO/u9YLx/src/loadsave.jl:219
 [18] action(::Symbol, ::Vector{Union{Base.PkgId, Module}}, ::FileIO.Formatted, ::String, ::PyObject)
    @ FileIO /srv/julia/pkg/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 /srv/julia/pkg/packages/FileIO/u9YLx/src/loadsave.jl:185
 [20] action
    @ /srv/julia/pkg/packages/FileIO/u9YLx/src/loadsave.jl:185 [inlined]
 [21] #save#20
    @ /srv/julia/pkg/packages/FileIO/u9YLx/src/loadsave.jl:129 [inlined]
 [22] save(::String, ::String, ::PyObject)
    @ FileIO /srv/julia/pkg/packages/FileIO/u9YLx/src/loadsave.jl:126
 [23] run()
    @ Main ~/Julia/fork/ODINN/src/scripts/toy_model.jl:45
 [24] top-level scope
    @ ~/Julia/fork/ODINN/src/scripts/toy_model.jl:120
Stacktrace:
  [1] handle_error(e::ErrorException, q::Base.PkgId, bt::Vector{Union{Ptr{Nothing}, Base.InterpreterIP}})
    @ FileIO /srv/julia/pkg/packages/FileIO/u9YLx/src/error_handling.jl:61
  [2] handle_exceptions(exceptions::Vector{Tuple{Any, Union{Base.PkgId, Module}, Vector}}, action::String)
    @ FileIO /srv/julia/pkg/packages/FileIO/u9YLx/src/error_handling.jl:56
  [3] action(::Symbol, ::Vector{Union{Base.PkgId, Module}}, ::FileIO.Formatted, ::String, ::Vararg{Any}; options::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ FileIO /srv/julia/pkg/packages/FileIO/u9YLx/src/loadsave.jl:228
  [4] action(::Symbol, ::Vector{Union{Base.PkgId, Module}}, ::FileIO.Formatted, ::String, ::PyObject)
    @ FileIO /srv/julia/pkg/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 /srv/julia/pkg/packages/FileIO/u9YLx/src/loadsave.jl:185
  [6] action
    @ /srv/julia/pkg/packages/FileIO/u9YLx/src/loadsave.jl:185 [inlined]
  [7] #save#20
    @ /srv/julia/pkg/packages/FileIO/u9YLx/src/loadsave.jl:129 [inlined]
  [8] save(::String, ::String, ::PyObject)
    @ FileIO /srv/julia/pkg/packages/FileIO/u9YLx/src/loadsave.jl:126
  [9] run()
    @ Main ~/Julia/fork/ODINN/src/scripts/toy_model.jl:45
 [10] top-level scope
    @ ~/Julia/fork/ODINN/src/scripts/toy_model.jl:120
in expression starting at /home/jovyan/Julia/fork/ODINN/src/scripts/toy_model.jl:120

@JordiBolibar
Copy link
Author

@cstjean Sorry to post again, but would it be possible to get some support for this issue? I really haven't been able to find a workaround for this. Thanks a lot in advance!

@cstjean
Copy link
Collaborator

cstjean commented Mar 31, 2022

Sorry, I'm swamped, and I don't have a clue how to fix this. If anything, this looks like a JLD issue. Maybe posting there could get some 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

2 participants