-
Notifications
You must be signed in to change notification settings - Fork 138
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
StackOverflowError (during training) #116
Comments
Ok. I took scripts\mcts.jl, changed "tictactoe" to my game and ran it. ERROR: LoadError: StackOverflowError: Please give me the right direction. |
I am getting overflow of gpu memory errors too. |
I re-ran using tic-tac toe game, and kept the System Monitor and the nvidia-smi tool to track hardware usage before the freeze. My video froze, and the memory was at very high usage, so I had the thought that it was a memory overflow problem. I then looked through the paramters (params.jl) and found a "memory buffer size" variable that I reduced by an order of magnitude (80k --> 8k). The code ran without crashing but learning was poor. I increased size to 40k, and it both ran and learned. There is a trade-off between "small enough to not crash" and "big enough to not act like a lobotomy". Manually hand-holding that is going to be a pain, but it is one way to limp forward. |
Thanks for the feedback. I will be adding an option to store memory buffer samples on disk. |
Yes please! 😘 |
I try to implement a new game.
Scripts.test_game and Scripts.dummy_run were passed OK.
After I run julia --project -e 'using AlphaZero; Scripts.train("best")',
I get this error message:
Initializing a new AlphaZero environment
Initial report
Running benchmark: AlphaZero against MCTS (1000 rollouts)
Stacktrace:
[1]
Stacktrace:Array
( #unused# [5]:: IndexLinear_unsafe_getindex, (A#unused#::::VectorIndexLinear{Int64}, , AI::::VectorBase.LogicalIndex{Int64}{Int64, StaticArrays.SVector{5, Bool}}, )I
:: @ Base.LogicalIndexBase{Int64, StaticArrays.SVector{5, Bool}} )./
multidimensional.jl:851 @ Base
./ [6]multidimensional.jl:851 _getindex
( game [8]:: AlphaZero.Examples.Best.GameEnvavailable_actions)(
game @ ::AlphaZero.GameInterfaceAlphaZero.Examples.Best.GameEnv )~/Downloads/Ju/AlphaZero.jl/src/
game.jl:320 @ AlphaZero.GameInterface
/Downloads/Ju/AlphaZero.jl/src/ [9]game.jl:320 run_simulation!/Downloads/Ju/AlphaZero.jl/src/( env [9]:: AlphaZero.MCTS.Envrun_simulation!{NamedTuple{(:board, :curplayer), Tuple{AlphaZero.Examples.Best.Board, Int64}}, AlphaZero.MCTS.RolloutOracle{AlphaZero.Examples.Best.GameSpec}}(, envgame::::AlphaZero.MCTS.EnvAlphaZero.Examples.Best.GameEnv{NamedTuple{(:board, :curplayer), Tuple{AlphaZero.Examples.Best.Board, Int64}}, AlphaZero.MCTS.RolloutOracle{AlphaZero.Examples.Best.GameSpec}}; , ηgame::::VectorAlphaZero.Examples.Best.GameEnv{Float64}; , ηroot::::VectorBool{Float64}),
root @ ::AlphaZero.MCTSBool )
mcts.jl:204 @ AlphaZero.MCTS
/Downloads/Ju/AlphaZero.jl/src/[10]mcts.jl:204 run_simulation!/Downloads/Ju/AlphaZero.jl/src/( env[10]:: AlphaZero.MCTS.Envrun_simulation!{NamedTuple{(:board, :curplayer), Tuple{AlphaZero.Examples.Best.Board, Int64}}, AlphaZero.MCTS.RolloutOracle{AlphaZero.Examples.Best.GameSpec}}(, envgame::::AlphaZero.MCTS.EnvAlphaZero.Examples.Best.GameEnv{NamedTuple{(:board, :curplayer), Tuple{AlphaZero.Examples.Best.Board, Int64}}, AlphaZero.MCTS.RolloutOracle{AlphaZero.Examples.Best.GameSpec}}; , ηgame::::VectorAlphaZero.Examples.Best.GameEnv{Float64}; , ηroot::::VectorBool{Float64}), (repeats 11814 times)root
:: @ BoolAlphaZero.MCTS) (repeats 11814 times)
mcts.jl:218 @ AlphaZero.MCTS
/Downloads/Ju/AlphaZero.jl/src/[11]mcts.jl:218 explore!/Downloads/Ju/AlphaZero.jl/src/( env[11]:: AlphaZero.MCTS.Envexplore!{NamedTuple{(:board, :curplayer), Tuple{AlphaZero.Examples.Best.Board, Int64}}, AlphaZero.MCTS.RolloutOracle{AlphaZero.Examples.Best.GameSpec}}(, envgame::::AlphaZero.MCTS.EnvAlphaZero.Examples.Best.GameEnv{NamedTuple{(:board, :curplayer), Tuple{AlphaZero.Examples.Best.Board, Int64}}, AlphaZero.MCTS.RolloutOracle{AlphaZero.Examples.Best.GameSpec}}, , nsimsgame::::Int64AlphaZero.Examples.Best.GameEnv),
nsims @ ::AlphaZero.MCTSInt64 )
mcts.jl:243 @ AlphaZero.MCTS
/Downloads/Ju/AlphaZero.jl/src/[12]mcts.jl:243 think/Downloads/Ju/AlphaZero.jl/src/( p[12]:: MctsPlayerthink{AlphaZero.MCTS.Env{NamedTuple{(:board, :curplayer), Tuple{AlphaZero.Examples.Best.Board, Int64}}, AlphaZero.MCTS.RolloutOracle{AlphaZero.Examples.Best.GameSpec}}}(, pgame::::MctsPlayerAlphaZero.Examples.Best.GameEnv{AlphaZero.MCTS.Env{NamedTuple{(:board, :curplayer), Tuple{AlphaZero.Examples.Best.Board, Int64}}, AlphaZero.MCTS.RolloutOracle{AlphaZero.Examples.Best.GameSpec}}}),
game @ ::AlphaZeroAlphaZero.Examples.Best.GameEnv )
play.jl:198 @ AlphaZero
~/Downloads/Ju/AlphaZero.jl/src/[13]play.jl:198 think
( gspec[14]:: AlphaZero.Examples.Best.GameSpecplay_game, (playergspec::::TwoPlayersAlphaZero.Examples.Best.GameSpec{MctsPlayer{AlphaZero.MCTS.Env{NamedTuple{(:board, :curplayer), Tuple{AlphaZero.Examples.Best.Board, Int64}}, AlphaZero.Batchifier.BatchedOracle{AlphaZero.Batchifier.var"#8#9"}}}, MctsPlayer{AlphaZero.MCTS.Env{NamedTuple{(:board, :curplayer), Tuple{AlphaZero.Examples.Best.Board, Int64}}, AlphaZero.MCTS.RolloutOracle{AlphaZero.Examples.Best.GameSpec}}}}, ; playerflip_probability::::TwoPlayersFloat64{MctsPlayer{AlphaZero.MCTS.Env{NamedTuple{(:board, :curplayer), Tuple{AlphaZero.Examples.Best.Board, Int64}}, AlphaZero.Batchifier.BatchedOracle{AlphaZero.Batchifier.var"#8#9"}}}, MctsPlayer{AlphaZero.MCTS.Env{NamedTuple{(:board, :curplayer), Tuple{AlphaZero.Examples.Best.Board, Int64}}, AlphaZero.MCTS.RolloutOracle{AlphaZero.Examples.Best.GameSpec}}}});
flip_probability @ ::AlphaZeroFloat64 )~/Downloads/Ju/AlphaZero.jl/src/
play.jl:308 @ AlphaZero
/Downloads/Ju/AlphaZero.jl/src/[15]play.jl:308 (::AlphaZero.var"#simulate_game#70"{TwoPlayers{MctsPlayer{AlphaZero.MCTS.Env{NamedTuple{(:board, :curplayer), Tuple{AlphaZero.Examples.Best.Board, Int64}}, AlphaZero.Batchifier.BatchedOracle{AlphaZero.Batchifier.var"#8#9"}}}, MctsPlayer{AlphaZero.MCTS.Env{NamedTuple{(:board, :curplayer), Tuple{AlphaZero.Examples.Best.Board, Int64}}, AlphaZero.MCTS.RolloutOracle{AlphaZero.Examples.Best.GameSpec}}}}, AlphaZero.Benchmark.var"#5#9"{ProgressMeter.Progress}, Simulator{AlphaZero.Benchmark.var"#4#8"{Env{AlphaZero.Examples.Best.GameSpec, ResNet, NamedTuple{(:board, :curplayer), Tuple{AlphaZero.Examples.Best.Board, Int64}}}, AlphaZero.Benchmark.Duel}, AlphaZero.Benchmark.var"#net#6"{Env{AlphaZero.Examples.Best.GameSpec, ResNet, NamedTuple{(:board, :curplayer), Tuple{AlphaZero.Examples.Best.Board, Int64}}}, AlphaZero.Benchmark.Duel}, typeof(record_trace)}, AlphaZero.Examples.Best.GameSpec, SimParams})/Downloads/Ju/AlphaZero.jl/src/( sim_id[15]:: Int64(::AlphaZero.var"#simulate_game#70"{TwoPlayers{MctsPlayer{AlphaZero.MCTS.Env{NamedTuple{(:board, :curplayer), Tuple{AlphaZero.Examples.Best.Board, Int64}}, AlphaZero.Batchifier.BatchedOracle{AlphaZero.Batchifier.var"#8#9"}}}, MctsPlayer{AlphaZero.MCTS.Env{NamedTuple{(:board, :curplayer), Tuple{AlphaZero.Examples.Best.Board, Int64}}, AlphaZero.MCTS.RolloutOracle{AlphaZero.Examples.Best.GameSpec}}}}, AlphaZero.Benchmark.var"#5#9"{ProgressMeter.Progress}, Simulator{AlphaZero.Benchmark.var"#4#8"{Env{AlphaZero.Examples.Best.GameSpec, ResNet, NamedTuple{(:board, :curplayer), Tuple{AlphaZero.Examples.Best.Board, Int64}}}, AlphaZero.Benchmark.Duel}, AlphaZero.Benchmark.var"#net#6"{Env{AlphaZero.Examples.Best.GameSpec, ResNet, NamedTuple{(:board, :curplayer), Tuple{AlphaZero.Examples.Best.Board, Int64}}}, AlphaZero.Benchmark.Duel}, typeof(record_trace)}, AlphaZero.Examples.Best.GameSpec, SimParams}))(
sim_id @ ::AlphaZeroInt64 )
simulations.jl:232 @ AlphaZero
~/Downloads/Ju/AlphaZero.jl/src/[16]simulations.jl:232 macro expansion
( )[17]
@ (::AlphaZero.Util.var"#9#10"{AlphaZero.var"#68#69"{AlphaZero.Benchmark.var"#5#9"{ProgressMeter.Progress}, Simulator{AlphaZero.Benchmark.var"#4#8"{Env{AlphaZero.Examples.Best.GameSpec, ResNet, NamedTuple{(:board, :curplayer), Tuple{AlphaZero.Examples.Best.Board, Int64}}}, AlphaZero.Benchmark.Duel}, AlphaZero.Benchmark.var"#net#6"{Env{AlphaZero.Examples.Best.GameSpec, ResNet, NamedTuple{(:board, :curplayer), Tuple{AlphaZero.Examples.Best.Board, Int64}}}, AlphaZero.Benchmark.Duel}, typeof(record_trace)}, AlphaZero.Examples.Best.GameSpec, SimParams, AlphaZero.var"#48#49"{Channel{Any}}, AlphaZero.var"#make#65"{Channel{Any}}}, UnitRange{Int64}, typeof(vcat), ReentrantLock})AlphaZero.Util( )~/.julia/packages/ThreadPools/hwwUU/src/
macros.jl:261 @ AlphaZero.Util ~/.julia/packages/ThreadPools/hwwUU/src/macros.jl:261
Please help
The text was updated successfully, but these errors were encountered: