Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ArgumentError: broadcasting over dictionaries and `NamedTuple`s is reserved when loading image in Julia

Tags:

julia

I am trying to load an image using images. I get the following error:

Error showing value of type Array{RGBA{Normed{UInt8,8}},2}:
ERROR: ArgumentError: broadcasting over dictionaries and `NamedTuple`s is reserved

I call

julia> using FileIO
julia> using Images
julia> img_holder = load("zone-map.png")
Error showing value of type Array{RGBA{Normed{UInt8,8}},2}:
ERROR: ArgumentError: broadcasting over dictionaries and `NamedTuple`s is reserved
Stacktrace: etc. etc. etc. 

Any thoughts on how to fix that?

Edit: I am getting the same error when I run the example from here: https://juliaimages.org/latest/function_reference/#ImageTransformations.imresize

So, maybe there's something wrong with my install? Here is the full stack track:

               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.0.3 (2018-12-18)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using Images
[ Info: Recompiling stale cache file /Users/logankilpatrick/.julia/compiled/v1.0/Images/H8Vxc.ji for Images [916415d5-f1e6-5110-898d-aaa5f9f070e0]
WARNING: Method definition _bcs1(Any, Any) in module Broadcast at broadcast.jl:439 overwritten in module ImageFiltering at /Users/logankilpatrick/.julia/packages/ImageFiltering/y5YkM/src/ImageFiltering.jl:28.

julia> using TestImages

julia> img = testimage("lena_gray_256")
Error showing value of type Array{Gray{Normed{UInt8,8}},2}:
ERROR: ArgumentError: broadcasting over dictionaries and `NamedTuple`s is reserved
Stacktrace:
 [1] broadcastable(::Dict{String,Any}) at ./broadcast.jl:618
 [2] broadcasted(::Function, ::Dict{String,Any}, ::Int64) at ./broadcast.jl:1171
 [3] plotsize() at /Users/logankilpatrick/.julia/packages/Atom/W03fL/src/frontend.jl:21
 [4] plotpane_io_ctx(::Base.GenericIOBuffer{Array{UInt8,1}}) at /Users/logankilpatrick/.julia/packages/Atom/W03fL/src/display/showdisplay.jl:5
 [5] displayinplotpane(::Array{Gray{Normed{UInt8,8}},2}) at /Users/logankilpatrick/.julia/packages/Atom/W03fL/src/display/showdisplay.jl:68
 [6] display(::Atom.JunoDisplay, ::Array{Gray{Normed{UInt8,8}},2}) at /Users/logankilpatrick/.julia/packages/Atom/W03fL/src/display/showdisplay.jl:102
 [7] display(::Any) at ./multimedia.jl:287
 [8] #invokelatest#1 at ./essentials.jl:697 [inlined]
 [9] invokelatest at ./essentials.jl:696 [inlined]
 [10] print_response(::IO, ::Any, ::Any, ::Bool, ::Bool, ::Any) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.0/REPL/src/REPL.jl:154
 [11] print_response(::REPL.AbstractREPL, ::Any, ::Any, ::Bool, ::Bool) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.0/REPL/src/REPL.jl:139
 [12] (::getfield(REPL, Symbol("#do_respond#40")){Bool,getfield(Atom, Symbol("##172#173")),REPL.LineEditREPL,REPL.LineEdit.Prompt})(::Any, ::Any, ::Any) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.0/REPL/src/REPL.jl:713
 [13] #invokelatest#1 at ./essentials.jl:697 [inlined]
 [14] invokelatest at ./essentials.jl:696 [inlined]
 [15] run_interface(::REPL.Terminals.TextTerminal, ::REPL.LineEdit.ModalInterface, ::REPL.LineEdit.MIState) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.0/REPL/src/LineEdit.jl:2273
 [16] run_frontend(::REPL.LineEditREPL, ::REPL.REPLBackendRef) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.0/REPL/src/REPL.jl:1034
 [17] run_repl(::REPL.AbstractREPL, ::Any) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.0/REPL/src/REPL.jl:191
 [18] (::getfield(Base, Symbol("##718#720")){Bool,Bool,Bool,Bool})(::Module) at ./client.jl:355
 [19] #invokelatest#1 at ./essentials.jl:697 [inlined]
 [20] invokelatest at ./essentials.jl:696 [inlined]
 [21] run_main_repl(::Bool, ::Bool, ::Bool, ::Bool, ::Bool) at ./client.jl:339
 [22] exec_options(::Base.JLOptions) at ./client.jl:277
 [23] _start() at ./client.jl:425

like image 610
logankilpatrick Avatar asked Nov 01 '25 15:11

logankilpatrick


1 Answers

This happens when there's a mismatch between the version of Atom.jl and julia-client (the Atom package).

Please make sure you're on at least v0.11.0 of Atom.jl when using julia-client 0.11.x -- it's a good idea to match minor versions in general. You should also be getting a warning like this:

Atom warning

like image 126
pfitzseb Avatar answered Nov 04 '25 11:11

pfitzseb



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!