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

Load not defined on HDF5 file #205

Closed
lstagner opened this issue Sep 18, 2018 · 4 comments
Closed

Load not defined on HDF5 file #205

lstagner opened this issue Sep 18, 2018 · 4 comments

Comments

@lstagner
Copy link

This should work right or am I doing something wrong? Error occurs on master FileIO and master HDF5

               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: https://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.7.0 (2018-08-08 06:46 UTC)
 _/ |\__'_|_|_|\__'_|  |  Official http://julialang.org/ release
|__/                   |  x86_64-pc-linux-gnu

julia> using HDF5

julia> f = h5open("test.h5","w")
HDF5 data file: test.h5

julia> f["a"] = 2
2

julia> close(f)

julia> using FileIO

julia> a = load("test.h5")
Error encountered while loading "test.h5".
Fatal error:
ERROR: UndefVarError: load not defined
Stacktrace:
 [1] getproperty at ./sysimg.jl:13 [inlined]
 [2] #load#27(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::File{DataFormat{:HDF5}}) at /home/lstagner/.julia/packages/FileIO/kflOT/src/loadsave.jl:185
 [3] load(::File{DataFormat{:HDF5}}) at /home/lstagner/.julia/packages/FileIO/kflOT/src/loadsave.jl:172
 [4] #load#13(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::String) at /home/lstagner/.julia/packages/FileIO/kflOT/src/loadsave.jl:118
 [5] load(::String) at /home/lstagner/.julia/packages/FileIO/kflOT/src/loadsave.jl:118
 [6] top-level scope at none:0

julia> query("test.h5")
File{DataFormat{:HDF5}}("test.h5")
@samusz
Copy link

samusz commented Aug 16, 2020

Reproduced on julia 1.5

'julia> A = collect(reshape(1:120, 15, 8))
15×8 Array{Int64,2}:
1 16 31 46 61 76 91 106
2 17 32 47 62 77 92 107
3 18 33 48 63 78 93 108
4 19 34 49 64 79 94 109
5 20 35 50 65 80 95 110
6 21 36 51 66 81 96 111
7 22 37 52 67 82 97 112
8 23 38 53 68 83 98 113
9 24 39 54 69 84 99 114
10 25 40 55 70 85 100 115
11 26 41 56 71 86 101 116
12 27 42 57 72 87 102 117
13 28 43 58 73 88 103 118
14 29 44 59 74 89 104 119
15 30 45 60 75 90 105 120

julia> h5write("/tmp/test2.h5", "mygroup2/A", A)

julia> data = h5read("/tmp/test2.h5", "mygroup2/A", (2:3:15, 3:5))
5×3 Array{Int64,2}:
32 47 62
35 50 65
38 53 68
41 56 71
44 59 74julia> B = FileIO.load("/tmp/test2.h5")
Error encountered while loading "/tmp/test2.h5".

Fatal error:
ERROR: UndefVarError: load not defined
Stacktrace:
[1] handle_error(::UndefVarError, ::File{DataFormat{:HDF5}}) at /Users/samusz/.julia/packages/FileIO/DzfYr/src/error_handling.jl:82
[2] handle_exceptions(::Array{Any,1}, ::String) at /Users/samusz/.julia/packages/FileIO/DzfYr/src/error_handling.jl:77
[3] load(::Formatted; options::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /Users/samusz/.julia/packages/FileIO/DzfYr/src/loadsave.jl:189
[4] load at /Users/samusz/.julia/packages/FileIO/DzfYr/src/loadsave.jl:166 [inlined]
[5] #load#13 at /Users/samusz/.julia/packages/FileIO/DzfYr/src/loadsave.jl:118 [inlined]
[6] load(::String) at /Users/samusz/.julia/packages/FileIO/DzfYr/src/loadsave.jl:118
[7] top-level scope at REPL[109]:1`

@lhupe
Copy link

lhupe commented Feb 22, 2021

I just noticed the same problem. I think the issue is that HDF5 just doesn't implement the FileIO API functions (JuliaIO/HDF5.jl#278).

@timholy
Copy link
Member

timholy commented Mar 3, 2021

Seems to be coming in JuliaIO/HDF5.jl#782

@musm
Copy link
Member

musm commented Jun 21, 2021

Fixed, although not on a tagged release just yet.

@musm musm closed this as completed Jun 21, 2021
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

5 participants