尺寸误差

时间:2018-06-29 05:45:55

标签: julia convolutional-neural-network

我正在尝试使用Julia中的flux来创建一个cnn。但是我遇到以下错误。

array_push($Array2,$Array1[0]);

我正在制作的模型如下:

LoadError: [91mDimensionMismatch("")[39m
while loading untitled-65dcf75c74c0859bdf206a333b2e1081, in expression starting on line 165
#conv2d!#48(::Tuple{Int64,Int64}, ::Tuple{Int64,Int64}, ::Int64, ::Int64, ::Float64, ::Function, ::Array{Float64,4}, ::Array{Float64,4}, ::Array{Float64,4}) at conv.jl:264
(::NNlib.#kw##conv2d!)(::Array{Any,1}, ::NNlib.#conv2d!, ::Array{Float64,4}, ::Array{Float64,4}, ::Array{Float64,4}) at <missing>:0
(::NNlib.#kw##conv!)(::Array{Any,1}, ::NNlib.#conv!, ::Array{Float64,4}, ::Array{Float64,4}, ::Array{Float64,4}) at <missing>:0
#conv#58(::Tuple{Int64,Int64}, ::Tuple{Int64,Int64}, ::Int64, ::Function, ::Array{Float64,4}, ::Array{Float64,4}) at conv.jl:29
(::NNlib.#kw##conv)(::Array{Any,1}, ::NNlib.#conv, ::Array{Float64,4}, ::Array{Float64,4}) at <missing>:0
track(::Flux.Tracker.Call{Flux.Tracker.#_conv,Tuple{Array{Float64,4},TrackedArray{…,Array{Float64,4}},Tuple{Int64,Int64},Tuple{Int64,Int64}}}) at Tracker.jl:41
#conv#31(::Tuple{Int64,Int64}, ::Tuple{Int64,Int64}, ::Function, ::Array{Float64,4}, ::TrackedArray{…,Array{Float64,4}}) at array.jl:321
(::NNlib.#kw##conv)(::Array{Any,1}, ::NNlib.#conv, ::Array{Float64,4}, ::TrackedArray{…,Array{Float64,4}}) at <missing>:0
(::Flux.Conv{2,NNlib.#relu,TrackedArray{…,Array{Float64,4}},TrackedArray{…,Array{Float64,1}}})(::Array{Float64,4}) at conv.jl:39
mapfoldl_impl(::Base.#identity, ::Flux.##81#82, ::Array{Float64,4}, ::Array{Any,1}, ::Int64) at reduce.jl:43
(::Flux.Chain)(::Array{Float64,4}) at basic.jl:31
loss(::Array{Float64,4}, ::Array{Any,1}) at untitled-65dcf75c74c0859bdf206a333b2e1081:150
macro expansion at train.jl:39 [inlined]
macro expansion at progress.jl:107 [inlined]
#train!#146(::Flux.Optimise.##147#149, ::Function, ::Function, ::Array{Any,1}, ::Flux.Optimise.##80#84) at train.jl:38
macro expansion at train.jl:65 [inlined]
macro expansion at progress.jl:107 [inlined]
anonymous at <missing>:?
include_string(::String, ::String) at loading.jl:522
include_string(::Module, ::String, ::String) at Compat.jl:88
(::Atom.##112#116{String,String})() at eval.jl:109
withpath(::Atom.##112#116{String,String}, ::Void) at utils.jl:30
withpath(::Function, ::String) at eval.jl:38
hideprompt(::Atom.##111#115{String,String}) at repl.jl:67
macro expansion at eval.jl:106 [inlined]

(::Atom.##110#114{Dict{String,Any}})() at task.jl:80

我认为问题可能在于计算密集层输入。有人可以帮我了解如何计算。如果您有其他看法,也请告诉我错误可能发生在哪里。

感谢您的帮助!

0 个答案:

没有答案