slimgroup / JUDI.jl

Julia Devito inversion.
https://slimgroup.github.io/JUDI.jl
MIT License
96 stars 30 forks source link

LoadError: MethodError: no method matching Array{Float32,1}(::Float32) #102

Closed WYJLCYWHZ closed 2 years ago

WYJLCYWHZ commented 2 years ago

Hi, when I run the the following example,

/examples/compressive_splsrtm/Sigsbee2A/generate_data_sigsbee.jl

the error persists.

ERROR: LoadError: MethodError: no method matching Array{Float32,1}(::Float32) Closest candidates are: Array{Float32,1}() where T at boot.jl:424 Array{Float32,1}(!Matched::UndefInitializer, !Matched::Int64) where T at boot.jl:405 Array{Float32,1}(!Matched::UndefInitializer, !Matched::Int64...) where {T, N} at boot.jl:411 ... Stacktrace: [1] (::JUDI.var"#26#29"{Array{Float32,1},Float32})(::Int64) at ./none:0 [2] iterate at ./generator.jl:47 [inlined] [3] collect at ./array.jl:665 [inlined] [4] Geometry(::Array{Array{Array{Float32,1},1},1}, ::Array{Float32,1}, ::Array{Array{Array{Float32,1},1},1}; dt::Float32, t::Float32) at /public/home/dongshiqi/.julia/packages/JUDI/BG8kx/src/TimeModeling/Types/GeometryStructure.jl:139 [5] Geometry(::Array{Any,1}, ::Array{Any,1}, ::Array{Any,1}; dt::Float32, t::Float32, nsrc::Nothing) at /public/home/dongshiqi/.julia/packages/JUDI/BG8kx/src/TimeModeling/Types/GeometryStructure.jl:127 [6] top-level scope at /public/home/dongshiqi/.julia/environments/v1.4/generate_data_sigsbee.jl:72 [7] include(::Module, ::String) at ./Base.jl:377 [8] exec_options(::Base.JLOptions) at ./client.jl:288 [9] _start() at ./client.jl:484 in expression starting at /public/home/dongshiqi/.julia/environments/v1.4/generate_data_sigsbee.jl:72

Do you have any suggestion for this please? I guess it may be caused by a version update.Thank you very much.

mloubout commented 2 years ago

Can I ask what version of JUDI you are working with?

It also looks like you are working with julia version 1.4, I would recommend to update to a more recent version as Julia only officially now supports 1.6 and above.

WYJLCYWHZ commented 2 years ago

The julia version I'm using is Version 1.4.2, I'll update the version to julia1.6 and retest it, which should seem to work. Thank you very much.

mloubout commented 2 years ago

See #103 , looks like was leftover setup from much older JUDI version. You can just copy paster the fix if you don't wanna wait for the PR to be merged

WYJLCYWHZ commented 2 years ago

请参阅 #103 ,看起来像是旧版 JUDI 的剩余设置。如果您不想等待 PR 合并,则可以复制粘贴修复程序

Wow! Amazing! ! My problem was solved perfectly, thank you so much. (^o^)

mloubout commented 2 years ago

Merged, will be in next release.