Replies: 1 comment
-
Figured it out. There is a problem in OptimizationOptimisers when the number of maxiters is less then the length of the data, which in turn sets epochs to 0. We raised an issue in Optimization.jl |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I followed the Lux optimization tutorial to implement the training of a convolutional network for noise cleaning of data. When I execute solve with the Optimiser.Adam() solver, I get the following error:
UndefVarError:
x` not defined in local scopeSuggestion: check for an assignment to a local variable that shadows a global of the same name.
Stacktrace:
[1] __solve(cache::OptimizationCache{OptimizationFunction{true, AutoZygote, typeof(loss), OptimizationZygoteExt.var"#grad#14"{Tuple{Array{Float32, 3}, Array{Float32, 3}}, OptimizationFunction{true, AutoZygote, typeof(loss), Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED_NO_TIME), Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing}, AutoZygote}, OptimizationZygoteExt.var"#fg!#16"{Tuple{Array{Float32, 3}, Array{Float32, 3}}, OptimizationFunction{true, AutoZygote, typeof(loss), Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED_NO_TIME), Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing}, AutoZygote}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED_NO_TIME), Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing}, OptimizationBase.ReInitCache{ComponentVector{Float32, Vector{Float32}, Tuple{Axis{(layer_1 = ViewAxis(1:180, Axis(weight = ViewAxis(1:162, ShapedAxis((9, 1, 18))), bias = 163:180)), layer_2 = ViewAxis(181:3150, Axis(layer_1 = ViewAxis(1:2934, Axis(weight = ViewAxis(1:2916, ShapedAxis((9, 18, 18))), bias = 2917:2934)), layer_2 = ViewAxis(2935:2970, Axis(scale = 1:18, bias = 19:36)))), layer_3 = ViewAxis(3151:6120, Axis(layer_1 = ViewAxis(1:2934, Axis(weight = ViewAxis(1:2916, ShapedAxis((9, 18, 18))), bias = 2917:2934)), layer_2 = ViewAxis(2935:2970, Axis(scale = 1:18, bias = 19:36)))), layer_4 = ViewAxis(6121:9090, Axis(layer_1 = ViewAxis(1:2934, Axis(weight = ViewAxis(1:2916, ShapedAxis((9, 18, 18))), bias = 2917:2934)), layer_2 = ViewAxis(2935:2970, Axis(scale = 1:18, bias = 19:36)))), layer_5 = ViewAxis(9091:12060, Axis(layer_1 = ViewAxis(1:2934, Axis(weight = ViewAxis(1:2916, ShapedAxis((9, 18, 18))), bias = 2917:2934)), layer_2 = ViewAxis(2935:2970, Axis(scale = 1:18, bias = 19:36)))), layer_6 = ViewAxis(12061:15030, Axis(layer_1 = ViewAxis(1:2934, Axis(weight = ViewAxis(1:2916, ShapedAxis((9, 18, 18))), bias = 2917:2934)), layer_2 = ViewAxis(2935:2970, Axis(scale = 1:18, bias = 19:36)))), layer_7 = ViewAxis(15031:18000, Axis(layer_1 = ViewAxis(1:2934, Axis(weight = ViewAxis(1:2916, ShapedAxis((9, 18, 18))), bias = 2917:2934)), layer_2 = ViewAxis(2935:2970, Axis(scale = 1:18, bias = 19:36)))), layer_8 = 18001:18000, layer_9 = ViewAxis(18001:18019, Axis(weight = ViewAxis(1:18, ShapedAxis((1, 18, 1))), bias = 19:19)))}}}, DataLoader{Tuple{Array{Float32, 3}, Array{Float32, 3}}, TaskLocalRNG, Val{nothing}}}, Nothing, Nothing, Nothing, Nothing, Nothing, Optimisers.Adam, Bool, typeof(callback), Nothing})
@ OptimizationOptimisers ~/.julia/packages/OptimizationOptimisers/JgTMl/src/OptimizationOptimisers.jl:155`
Any ideas. I looked at the code. It defines a local x, but depending on the conditional statements it may not be set to anything. Could this be because of a cache that I did not clear? Also, I am not using x for anything in my code.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions