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: convert has no method matching convert(::Type{Int64...}, ::Uint64) #160

Closed
Jutho opened this issue Oct 8, 2014 · 19 comments
Closed

Comments

@Jutho
Copy link
Contributor

Jutho commented Oct 8, 2014

I seem to be getting this quite a few times.

ERROR: `convert` has no method matching convert(::Type{Int64...}, ::Uint64)
 in convert at base.jl:9
 in convert at base.jl:17
 in read at /Users/jutho/.julia/v0.4/HDF5/src/JLD.jl:301
 in read at /Users/jutho/.julia/v0.4/HDF5/src/JLD.jl:284

My variables are normal Arrays and both saved and opened with HDF5.jl version 4.3.

@timholy
Copy link
Member

timholy commented Oct 8, 2014

Can you provide an explicit test case?

@Jutho
Copy link
Contributor Author

Jutho commented Oct 8, 2014

Hold on, there seems to be some interference with PyPlot. The error does not occur if I don't use using PyPlot at the same time, at least that seems to be the case right now. I will investigate further...

@Jutho
Copy link
Contributor Author

Jutho commented Oct 8, 2014

Ok, so I am on latest master

Julia Version 0.4.0-dev+1012
Commit 139fa47* (2014-10-08 19:49 UTC)

with latest HDF5.jl (0.4.3) and PyPlot.jl (1.4.0).

In a freshly opened Julia REPL, doing this

using PyPlot
using HDF5, JLD
f=jldopen("newspectrum_32_1.30_0.45.jld","r")
spectrum1=read(f,"spectrum1")
close(f)

fails with the aforementioned error. Exiting and restarting Julia, this then works

using HDF5, JLD
f=jldopen("newspectrum_32_1.30_0.45.jld","r")
spectrum1=read(f,"spectrum1")
close(f)

If I do using PyPlot afterwards, I can reopen the previous file and read more data, however, opening a different file and trying to read data gives the aforementioned error.

Not sure if I need to report this here, at PyPlot.jl or at Julia itself. I can try to share the dataset.

@Jutho
Copy link
Contributor Author

Jutho commented Oct 8, 2014

All this data is on my Dropbox folder, so I can just share this:
https://www.dropbox.com/s/3tabil14bxxrfkk/newspectrum_32_1.30_0.45.jld?dl=0

@simonster
Copy link
Member

Somehow, loading PyPlot breaks:

convert((Int...), (uint(1),))

@Jutho
Copy link
Contributor Author

Jutho commented Oct 8, 2014

That's a surprisingly simple and yet very surprising explanation. Thanks.
I'll report it at PyPlot.jl.

@timholy
Copy link
Member

timholy commented Oct 8, 2014

Note that convert seems to have a number of issues, though: JuliaLang/julia#8618
JuliaLang/julia#8128
It's quite possible it's PyPlot's problem, but also possible this is exposing some other issue. convert has more methods than just about anything.

@simonster
Copy link
Member

Definitely a Julia bug, and actually triggered by Color.jl:

julia> using Color

[deprecation warnings...]

julia> convert((Int...), (uint(1),))
ERROR: `convert` has no method matching convert(::Type{Int64...}, ::Uint64)
 in convert at base.jl:9
 in convert at base.jl:17

julia> f() = convert((Int...), (uint(1),));

julia> f()
(1,)

@Jutho
Copy link
Contributor Author

Jutho commented Oct 8, 2014

Ok thanks. I'll hold off reporting this.

@timholy
Copy link
Member

timholy commented Oct 8, 2014

See JuliaLang/julia#8631. Nice detective work, folks.

@CCWRoy
Copy link

CCWRoy commented Oct 17, 2014

I just ran into this issue, and found this ticket via web search.

I see Issue #8631 references this issue, so I'll post here to let others know this issue between JLD.load(), convert, and PyPlot also exists in v0.3.1. To reproduce the error, start a new Julia REPL session, and type:

import PyPlot
import HDF5,JLD 
a=[1:5];
JLD.save("hi.jld","a",a)
z=JLD.load("hi.jld");
b=z["a"];

or

import PyPlot
import HDF5,JLD 
a=[1:5];
JLD.save("hi.jld","a",a)
z=JLD.load("hi.jld");
b=z["a"];

both give:

ERROR: `convert` has no method matching convert(::Type{Int64...}, ::Uint64)
 in convert at base.jl:13
 in convert at base.jl:21
 in read at /home/roy/.julia/v0.3/HDF5/src/JLD.jl:301
 in read at /home/roy/.julia/v0.3/HDF5/src/JLD.jl:284
 in anonymous at /home/roy/.julia/v0.3/HDF5/src/JLD.jl:932
 in jldopen at /home/roy/.julia/v0.3/HDF5/src/JLD.jl:205
 in load at /home/roy/.julia/v0.3/HDF5/src/JLD.jl:931

import PyCall works though.

@timholy
Copy link
Member

timholy commented Oct 17, 2014

Does pinning your version of Color work? See JuliaAttic/Color.jl#68.

It does seem there is some long-lurking bug that this has just exposed.

@CCWRoy
Copy link

CCWRoy commented Oct 18, 2014

Ah hah! Thanks! I verified pinning Color.jl to v0.3.9 would not cause the JLD.load() and convert problem I posted here.

@timholy
Copy link
Member

timholy commented Nov 28, 2014

Update: hopefully this is fixed with the latest release of Color, so do a Pkg.update().

@timholy
Copy link
Member

timholy commented Dec 3, 2014

Updated Color fixes some problems, so it's worth trying, but not the specific test case here. See JuliaLang/julia#8631

@GunnarFarneback
Copy link

Maybe it's already known but the commit in Color triggering this was 9367c4ef754580693cac5258859256717d812791

@timholy
Copy link
Member

timholy commented Dec 4, 2014

Do you have any clue why that commit causes this problem?

@GunnarFarneback
Copy link

None at all. That was the point when I gave up debugging and started searching for issues.

GunnarFarneback added a commit to GunnarFarneback/Color.jl that referenced this issue Dec 6, 2014
Switching the colormaps_sequential and colormaps_diverging values from tuples to vectors works around the Julia bug JuliaLang/julia#8631, solving JuliaAttic#68 and JuliaIO/HDF5.jl#160.
@GunnarFarneback
Copy link

This issue should be safe to close now.

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