karthikncode / text-world-player

Framework and model code for the paper "Language Understanding for Text-based Games using Deep Reinforcement Learning", EMNLP 2015
http://arxiv.org/pdf/1506.08941v2.pdf
MIT License
127 stars 32 forks source link

run-time error: lstm_embedding.lua: attempt to index field 'inputs' (a nil value) #3

Closed yongduek closed 8 years ago

yongduek commented 8 years ago

Hello, I am yndk@sogang.ac.kr. I succeeded in running the code but found an error occurred after 1000 steps, as follows.

$ run_cpu 2 -recurrent 1 -name logs/run1/DQN -agent NeuralQLearner -agent_params lr=0.0005,ep=1,ep_end=0.2,ep_endt=200000,discount=0.5,hist_len=1,learn_start=1000,replay_memory=100000,update_freq=4,n_replay=1,network="lstm_embedding",state_dim=100,minibatch_size=64,rescale_r=1,ncols=1,bufferSize=512,valid_size=500,target_q=1000,clip_delta=1,min_reward=-1,max_reward=10 -steps 2000000 -eval_freq 1000 -eval_steps 1000 -prog_freq 1000 -save_freq 1000 -actrep 1 -gpu -1 -random_starts 30 -seed 1 -threads 1 { name : "logs/run1/DQN" network : "" random_starts : 30 gpu : -1 eval_freq : 1000 wordvec_file : "wordvec.eng" env_params : "" framework : "" agent : "NeuralQLearner" steps : 2000000 save_versions : 0 eval_steps : 1000 seed : 1 prog_freq : 1000 text_world_location : "./text-world-master/" tutorial_world : 0 max_steps : 20 game_num : 2 quest_levels : 1 saveNetworkParams : true exp_folder : "logs/run1/" bigram : 0 env : "" recurrent : 1 state_dim : 100 use_wordvec : 0 agent_params : "lr=0.0005,ep=1,ep_end=0.2,ep_endt=200000,discount=0.5,hist_len=1,learn_start=1000,replay_memory=100000,update_freq=4,n_replay=1,network="lstm_embedding",state_dim=100,minibatch_size=64,rescale_r=1,ncols=1,bufferSize=512,valid_size=500,target_q=1000,clip_delta=1,min_reward=-1,max_reward=10" threads : 1 actrep : 1 analyze_test : 0 verbose : 2 save_freq : 1000 random_test : 0 } 100 Tutorial world false
4002
tcp no delay 1
{} yndk: text_world_location: ./text-world-master/

symbols 85

state_dim 100 Creating Agent Network from lstm_embedding
nn.Sequential { input -> (1) -> (2) -> (3) -> (4) -> output: nn.ParallelTable { input |-> (1): nn.LookupTable |-> (2): nn.Identity |-> (3): nn.Identity ... -> output } (2): nn.ConcatTable { input |-> (1): nn.ConcatTable { | input | |-> (1): nn.SelectTable | |-> (2): nn.SelectTable | ... -> output | } |-> (2): nn.Sequential { | [input -> (1) -> (2) -> output] | (1): nn.ConcatTable { | input | |-> (1): nn.Sequential { | | [input -> (1) -> (2) -> output] | | (1): nn.ConcatTable { | | input | | |-> (1): nn.Sequential { | | | [input -> (1) -> (2) -> (3) -> output] | | | (1): nn.ParallelTable { | | | input | | | |-> (1): nn.Linear(20 -> 20) | | | |-> (2): nn.LinearNoBias(20 -> 20) without bias | | | |-> (3): nn.CMul | | | ... -> output | | | } | | | (2): nn.CAddTable | | | (3): nn.Sigmoid | | | } | | |-> (2): nn.SelectTable | | ... -> output | | } | | (2): nn.CMulTable | | } | |-> (2): nn.Sequential { | | [input -> (1) -> (2) -> output] | | (1): nn.ConcatTable { | | input | | |-> (1): nn.Sequential { | | | [input -> (1) -> (2) -> (3) -> output] | | | (1): nn.ParallelTable { | | | input | | | |-> (1): nn.Linear(20 -> 20) | | | |-> (2): nn.LinearNoBias(20 -> 20) without bias | | | |-> (3): nn.CMul | | | ... -> output | | | } | | | (2): nn.CAddTable | | | (3): nn.Sigmoid | | | } | | |-> (2): nn.Sequential { | | | [input -> (1) -> (2) -> (3) -> (4) -> output] | | | (1): nn.NarrowTable | | | (2): nn.ParallelTable { | | | input | | | |-> (1): nn.Linear(20 -> 20) | | | |-> (2): nn.LinearNoBias(20 -> 20) without bias | | | ... -> output | | | } | | | (3): nn.CAddTable | | | (4): nn.Tanh | | | } | | ... -> output | | } | | (2): nn.CMulTable | | } | ... -> output | } | (2): nn.CAddTable | } ... -> output } (3): nn.FlattenTable (4): nn.ConcatTable { input |-> (1): nn.Sequential { | [input -> (1) -> (2) -> output] | (1): nn.ConcatTable { | input | |-> (1): nn.Sequential { | | [input -> (1) -> (2) -> (3) -> output] | | (1): nn.ParallelTable { | | input | | |-> (1): nn.Linear(20 -> 20) | | |-> (2): nn.LinearNoBias(20 -> 20) without bias | | |-> (3): nn.CMul | | ... -> output | | } | | (2): nn.CAddTable | | (3): nn.Sigmoid | | } | |-> (2): nn.Sequential { | | [input -> (1) -> (2) -> output] | | (1): nn.SelectTable | | (2): nn.Tanh | | } | ... -> output | } | (2): nn.CMulTable | } |-> (2): nn.SelectTable ... -> output } } state dim multiplier 1
Started RL based training ...
[Start] Network weight sum: 218.00921482709 [........................................ 1000/2000000 ................................] ETA: 21h28m | Step: 38ms
Steps: 1000 | Achieved quest level, current reward: 10
Weight norms: nn.Sequential: [nn.ParallelTable: [nn.Sequential: [nn.Sequencer: [nn.LSTM: [nn.Sequential: [nn.ParallelTable: [nn.LookupTable: 0.76463870636946 ] nn.ConcatTable: [nn.ConcatTable: [] nn.Sequential: [nn.ConcatTable: [nn.Sequential: [nn.ConcatTable: [nn.Sequential: [nn.ParallelTable: [nn.Linear: 0.10920305149149 nn.LinearNoBias: 0.10888609549005 nn.CMul: 0.12083421624266] ] ] ] nn.Sequential: [nn.ConcatTable: [nn.Sequential: [nn.ParallelTable: [nn.Linear: 0.10830776578063 nn.LinearNoBias: 0.10963458536513 nn.CMul: 0.10933770274278] ] nn.Sequential: [nn.ParallelTable: [nn.Linear: 0.11439867521265 nn.LinearNoBias: 0.10899572591428] ]] ]] ]] nn.ConcatTable: [nn.Sequential: [nn.ConcatTable: [nn.Sequential: [nn.ParallelTable: [nn.Linear: 0.11002315328107 nn.LinearNoBias: 0.11395968002766 nn.CMul: 0.10951949392329] ] nn.Sequential: []] ] ]]]] nn.Linear: 0.11166976523629 ]] nn.ConcatTable: [nn.Linear: 0.12292005542666 nn.Linear: 0.10830144135725]] Weight max: nn.Sequential: [nn.ParallelTable: [nn.Sequential: [nn.Sequencer: [nn.LSTM: [nn.Sequential: [nn.ParallelTable: [nn.LookupTable: 4.2891473770142 ] nn.ConcatTable: [nn.ConcatTable: [] nn.Sequential: [nn.ConcatTable: [nn.Sequential: [nn.ConcatTable: [nn.Sequential: [nn.ParallelTable: [nn.Linear: 0.22346332669258 nn.LinearNoBias: 0.22309909760952 nn.CMul: 0.20805893838406] ] ] ] nn.Sequential: [nn.ConcatTable: [nn.Sequential: [nn.ParallelTable: [nn.Linear: 0.2235576659441 nn.LinearNoBias: 0.22341561317444 nn.CMul: 0.21414142847061] ] nn.Sequential: [nn.ParallelTable: [nn.Linear: 0.22314922511578 nn.LinearNoBias: 0.22349005937576] ]] ]] ]] nn.ConcatTable: [nn.Sequential: [nn.ConcatTable: [nn.Sequential: [nn.ParallelTable: [nn.Linear: 0.2230963408947 nn.LinearNoBias: 0.2229900509119 nn.CMul: 0.22189036011696] ] nn.Sequential: []] ] ]]]] nn.Linear: 0.22316665947437 ]] nn.ConcatTable: [nn.Linear: 0.22355765104294 nn.Linear: 0.22335508465767]] Weight grad norms: nn.Sequential: [nn.ParallelTable: [nn.Sequential: [nn.Sequencer: [nn.LSTM: [nn.Sequential: [nn.ParallelTable: [nn.LookupTable: 0 ] nn.ConcatTable: [nn.ConcatTable: [] nn.Sequential: [nn.ConcatTable: [nn.Sequential: [nn.ConcatTable: [nn.Sequential: [nn.ParallelTable: [nn.Linear: 0 nn.LinearNoBias: 0 nn.CMul: 0] ] ] ] nn.Sequential: [nn.ConcatTable: [nn.Sequential: [nn.ParallelTable: [nn.Linear: 0 nn.LinearNoBias: 0 nn.CMul: 0] ] nn.Sequential: [nn.ParallelTable: [nn.Linear: 0 nn.LinearNoBias: 0] ]] ]] ]] nn.ConcatTable: [nn.Sequential: [nn.ConcatTable: [nn.Sequential: [nn.ParallelTable: [nn.Linear: 0 nn.LinearNoBias: 0 nn.CMul: 0] ] nn.Sequential: []] ] ]]]] nn.Linear: 0 ]] nn.ConcatTable: [nn.Linear: 0 nn.Linear: 0]] Weight grad max: nn.Sequential: [nn.ParallelTable: [nn.Sequential: [nn.Sequencer: [nn.LSTM: [nn.Sequential: [nn.ParallelTable: [nn.LookupTable: 0 ] nn.ConcatTable: [nn.ConcatTable: [] nn.Sequential: [nn.ConcatTable: [nn.Sequential: [nn.ConcatTable: [nn.Sequential: [nn.ParallelTable: [nn.Linear: 0 nn.LinearNoBias: 0 nn.CMul: 0] ] ] ] nn.Sequential: [nn.ConcatTable: [nn.Sequential: [nn.ParallelTable: [nn.Linear: 0 nn.LinearNoBias: 0 nn.CMul: 0] ] nn.Sequential: [nn.ParallelTable: [nn.Linear: 0 nn.LinearNoBias: 0] ]] ]] ]] nn.ConcatTable: [nn.Sequential: [nn.ConcatTable: [nn.Sequential: [nn.ParallelTable: [nn.Linear: 0 nn.LinearNoBias: 0 nn.CMul: 0] ] nn.Sequential: []] ] ]]]] nn.Linear: 0 ]] nn.ConcatTable: [nn.Linear: 0 nn.Linear: 0]]
Network weight sum: 218.00921482709 Saved: logs/run1/DQN.t7
/Users/yndk/torch/install/bin/luajit: /Users/yndk/torch/install/share/lua/5.1/nn/Container.lua:69: 55m | Step: 41ms
In 1 module of nn.Sequential: In 1 module of nn.ParallelTable: In 1 module of nn.Sequential: ./lstm_embedding.lua:84: attempt to index field 'inputs' (a nil value) stack traceback: ./lstm_embedding.lua:84: in function 'updateOutput' /Users/yndk/torch/install/share/lua/5.1/rnn/Sequencer.lua:48: in function </Users/yndk/torch/install/share/lua/5.1/rnn/Sequencer.lua:37> [C]: in function 'xpcall' /Users/yndk/torch/install/share/lua/5.1/nn/Container.lua:65: in function 'rethrowErrors' /Users/yndk/torch/install/share/lua/5.1/nn/Sequential.lua:44: in function </Users/yndk/torch/install/share/lua/5.1/nn/Sequential.lua:41> [C]: in function 'xpcall' /Users/yndk/torch/install/share/lua/5.1/nn/Container.lua:65: in function 'rethrowErrors' ...rs/yndk/torch/install/share/lua/5.1/nn/ParallelTable.lua:12: in function <...rs/yndk/torch/install/share/lua/5.1/nn/ParallelTable.lua:10> [C]: in function 'xpcall' /Users/yndk/torch/install/share/lua/5.1/nn/Container.lua:65: in function 'rethrowErrors' /Users/yndk/torch/install/share/lua/5.1/nn/Sequential.lua:44: in function 'forward' ./NeuralQLearner.lua:191: in function 'getQUpdate' ./NeuralQLearner.lua:268: in function 'qLearnMinibatch' ./NeuralQLearner.lua:412: in function 'perceive' agent.lua:201: in main chunk [C]: in function 'dofile' ...yndk/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk [C]: at 0x01034fcad0

WARNING: If you see a stack trace below, it doesn't point to the place where this error occured. Please use only the one above. stack traceback: [C]: in function 'error' /Users/yndk/torch/install/share/lua/5.1/nn/Container.lua:69: in function 'rethrowErrors' /Users/yndk/torch/install/share/lua/5.1/nn/Sequential.lua:44: in function 'forward' ./NeuralQLearner.lua:191: in function 'getQUpdate' ./NeuralQLearner.lua:268: in function 'qLearnMinibatch' ./NeuralQLearner.lua:412: in function 'perceive' agent.lua:201: in main chunk [C]: in function 'dofile' ...yndk/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk [C]: at 0x01034fcad0

taey16 commented 8 years ago

Hi, I also met the same problem. Give me advices or comments to this problem. Thanks in advance

karthikncode commented 8 years ago

Thanks for catching that - looks like the issue was due to an updated version of the 'rnn' package. Please pull and try again.

taey16 commented 8 years ago

@karthikncode Thanks to your kindly efforts.