Code Monkey home page Code Monkey logo

arnold's People

Contributors

devendrachaplot avatar glample avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arnold's Issues

Could not initialize SDL video:

I tried to run it on linux(the wsl) but things turned to be complex:
Traceback (most recent call last):
File "arnold.py", line 24, in
parse_game_args(remaining + ['--dump_path', dump_path])
File "/mnt/d/yuan/Arnold-master/src/args.py", line 114, in parse_game_args
module.main(parser, args)
File "/mnt/d/yuan/Arnold-master/src/doom/scenarios/defend_the_center.py", line 90, in main
evaluate_defend_the_center(game, network, params)
File "/mnt/d/yuan/Arnold-master/src/doom/scenarios/defend_the_center.py", line 107, in evaluate_defend_the_center
game.start(map_id=map_id, episode_time=params.episode_time, log_events=True)
File "/mnt/d/yuan/Arnold-master/src/doom/game.py", line 491, in start
self.game.init()
vizdoom.vizdoom.ViZDoomErrorException: Could not initialize SDL video:
No available video device

AssertionError

Traceback (most recent call last):
  File "arnold.py", line 24, in <module>
    parse_game_args(remaining + ['--dump_path', dump_path])
  File "/home/ricardoliu/Arnold/src/args.py", line 114, in parse_game_args
    module.main(parser, args)
  File "/home/ricardoliu/Arnold/src/doom/scenarios/health_gathering.py", line 101, in main
    evaluate_health_gathering(game, network, params)
  File "/home/ricardoliu/Arnold/src/doom/scenarios/health_gathering.py", line 144, in evaluate_health_gathering
    action = network.next_action(last_states)
  File "/home/ricardoliu/Arnold/src/model/dqn/base.py", line 193, in next_action
    scores, pred_features = self.f_eval(last_states)
  File "/home/ricardoliu/Arnold/src/model/dqn/feedforward.py", line 51, in f_eval
    [variables[-1, i] for i in range(self.params.n_variables)]
  File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 477, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/ricardoliu/Arnold/src/model/dqn/feedforward.py", line 27, in forward
    for x in x_variables)
AssertionError

training in deathmatch

Hi, when I run "python arnold.py --scenario deathmatch --wad deathmatch_rockets --n_bots 8
--action_combinations "move_fb;move_lr;turn_lr;attack" --frame_skip 4
--game_features "enemy" --network_type dqn_rnn --recurrence lstm --n_rec_updates 5"

some error happen:
NFO [25900] - 04/19/18 18:46:51 - 0:00:00 - Input shape: (3, 60, 108)
INFO [25900] - 04/19/18 18:46:51 - 0:00:00 - Conv layer output dim : 4608
INFO [25900] - 04/19/18 18:46:51 - 0:00:00 - Hidden layer input dim: 4672
Traceback (most recent call last):
File "arnold.py", line 24, in
parse_game_args(remaining + ['--dump_path', dump_path])
File "/home/wwx/Arnold/src/args.py", line 114, in parse_game_args
module.main(parser, args)
File "/home/wwx/Arnold/src/doom/scenarios/deathmatch.py", line 110, in main
network = get_model_class(params.network_type)(params)
File "/home/wwx/Arnold/src/model/dqn/recurrent.py", line 62, in init
super(DQNRecurrent, self).init(params)
File "/home/wwx/Arnold/src/model/dqn/base.py", line 119, in init
self.module.cuda()
File "/home/wwx/anaconda3/envs/doom/lib/python3.5/site-packages/torch/nn/modules/module.py", line 216, in cuda
return self._apply(lambda t: t.cuda(device))
File "/home/wwx/anaconda3/envs/doom/lib/python3.5/site-packages/torch/nn/modules/module.py", line 146, in _apply
module._apply(fn)
File "/home/wwx/anaconda3/envs/doom/lib/python3.5/site-packages/torch/nn/modules/rnn.py", line 123, in _apply
self.flatten_parameters()
File "/home/wwx/anaconda3/envs/doom/lib/python3.5/site-packages/torch/nn/modules/rnn.py", line 111, in flatten_parameters
params = rnn.get_parameters(fn, handle, fn.weight_buf)
File "/home/wwx/anaconda3/envs/doom/lib/python3.5/site-packages/torch/backends/cudnn/rnn.py", line 165, in get_parameters
assert filter_dim_a.prod() == filter_dim_a[0]
AssertionError

FileNotFoundError:

when I download the code and run arnold.py using pycharm in Windows, things go like that:

FileNotFoundError: [Errno 2] No such file or directory: 'D:\PyCharmproject\Arnold-master\Arnold-master\dumped\default\vhzihaaocq\train.log'
Can this programm run successfully using Win10?

Question about batch size

hello glample,I want to know why the default batch size is set to 32. Is there any special meaning?Have you tried a larger batch size for training? @glample

No such file or directory, confusing concatenation?

(I'm using a conda environment on windows) When trying to run from the root directory:

python arnold.py --exp_name test --main_dump_path dumped --scenario defend_the_center --frame_skip 2 --action_combinations "turn_lr+attack" --reload pretrained/defend_the_center.pth --evaluate 1 --visualize 1 --gpu_id 0

I get the error No such file or directory: 'dumped\\test\\<testid>\\pretrained/defend_the_center.pth'.
Looking into this I saw that the paths are concatenated.

Shouldn't the weights be loaded from the pretrained directory instead?
Eg:
model_path = params.reload

What is the expected functionality?

Error While training

When I try to train the model on a kaggle by running

python arnold.py
--freedoom "true"                # use freedoom resources
--height 60                      # screen height
--width 108                      # screen width
--gray "false"                   # use grayscale screen
--use_screen_buffer "true"       # use the screen buffer (what the player sees)
--use_depth_buffer "false"       # use the depth buffer
--labels_mapping ""              # use extra feature maps for specific objects
--game_features "target,enemy"   # game features prediction (auxiliary tasks)
--render_hud "false"             # render the HUD (status bar in the bottom of the screen)
--render_crosshair "true"        # render crosshair (targeting aid in the center of the screen)
--render_weapon "true"           # render weapon
--hist_size 4                    # history size
--frame_skip 4                   # frame skip (1 = keep every frame)


--action_combinations "attack+move_lr;turn_lr;move_fb"  # agent allowed actions
--freelook "false"               # allow the agent to look up and down
--speed "on"                     # make the agent run
--crouch "off"                   # make the agent crouch


--batch_size 32                  # batch size
--replay_memory_size 1000000     # maximum number of frames in the replay memory
--start_decay 0                  # epsilon decay iteration start
--stop_decay 1000000             # epsilon decay iteration end
--final_decay 0.1                # final epsilon value
--gamma 0.99                     # discount factor gamma
--dueling_network "false"        # use a dueling architecture
--clip_delta 1.0                 # clip the delta loss
--update_frequency 4             # DQN update frequency
--dropout 0.5                    # dropout on CNN output layer
--optimizer "rmsprop,lr=0.0002"  # network optimizer


--network_type "dqn_rnn"         # network type (dqn_ff / dqn_rnn)
--recurrence "lstm"              # recurrent network type (rnn / gru / lstm)
--n_rec_layers 1                 # number of layers in the recurrent network
--n_rec_updates 5                # number of updates by sample
--remember 1                     # remember all frames during evaluation
--use_bn "off"                   # use BatchNorm when processing the screen
--variable_dim "32"              # game variables embeddings dimension
--bucket_size "[10, 1]"          # bucket game variables (typically health / ammo)
--hidden_dim 512                 # hidden layers dimension


--scenario "deathmatch"          # scenario
--wad "full_deathmatch"          # WAD file (scenario file)
--map_ids_train "2,3,4,5"        # maps to train the model
--map_ids_test "6,7,8"           # maps to test the model
--n_bots 8                       # number of enemy bots
--randomize_textures "true"      # randomize walls / floors / ceils textures during training
--init_bots_health 20            # reduce initial life of enemy bots (helps a lot when using pistol)

--exp_name new_train             # experiment name
--dump_freq 200000               # periodically dump the model
--gpu_id -1 

I get the following Error
Can someone help me fix this

How to combine LSTM and experience replay

I notice that you use replay buffer with experience decomposed into independent screens, while processing these screens with a LSTM layer. From my point of view, LSTM has a strong relationship with temporal sequence and seems to be unsuitable for this kind of usage. Did I miss anything?

probelms in comparing code to article "Playing FPS Games with Deep Reinforcement Learning"

as far as i understand according to the article there are supposed to be two neural nets.
one DQN for navigation scope decision and the other DRQN for action scope decision and feature extraction. in the code i don't see the option of 2 networks loading simultaneously. also in the next_action function i don't see any use of the game_features that extracted from DRQN net.

Not support PyTorch 0.4.0

I test the code using PyTorch 0.4.0 under windows, it occurs an error beacase of the changed 'Variable' in PyTorch 0.4.0. Then I test on PyTorch 0.3.1, it's ok.

What's the training settings for track_1 and track_2 model

First of all thanks for releasing the source code for the successful training of Doom agents.
The pretrained models contain the winner model of the last year's competition. May I know what's the exact training setting for those two models? Does it requires some curriculum learning stages?
Thanks very much.

Different dimensions between model and checkpoint

I run this command at the terminal:
python arnold.py --scenario deathmatch --wad deathmatch_rockets --n_bots 8 --action_combinations "move_fb;move_lr;turn_lr;attack" --frame_skip 4 --game_features "enemy" --network_type dqn_rnn --recurrence lstm --n_rec_updates 5 --visualize 1 --evaluate 1 --manual_control 1 --reload /home/yang/src/Arnold/pretrained/deathmatch_shotgun.pth
And this error occur:
Traceback (most recent call last): File "arnold.py", line 24, in <module> parse_game_args(remaining + ['--dump_path', dump_path]) File "/home/yang/src/Arnold/src/args.py", line 114, in parse_game_args module.main(parser, args) File "/home/yang/src/Arnold/src/doom/scenarios/deathmatch.py", line 116, in main network.module.load_state_dict(reloaded) File "/home/yang/local/anaconda3/envs/py35/lib/python3.5/site-packages/torch/nn/modules/module.py", line 519, in load_state_dict .format(name, own_state[name].size(), param.size())) RuntimeError: While copying the parameter named conv.0.weight, whose dimensions in the model are torch.Size([32, 3, 8, 8]) and whose dimensions in the checkpoint are torch.Size([32, 4, 8, 8]).
Do you know why?Thanks a lot.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.