This repository has been archived by the owner on Dec 11, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 566
failed to load the pretrained v2 model to run Go bot #138
Comments
#133 (comment) |
did you try the sever.sh and client.sh? |
No :( |
This is probably because of the version of PyTorch. A fix is on the way. |
I use 1.0.1 with elf_convert.py too, but the windows binary df_console.exe shouldnt require pytorch installed by user
|
suggest df_console.exe also support load elfv2.bin and train data such as 1500000.bin etc |
Could you please try the newly-revised gtp.sh in master? |
I download todays
and run the cpu version with buildin sabaki
|
but the gpu version works
|
and the gpu version also support --load weights
some tests
|
test elf v1 weight
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi guys,
I completely followed the project homepage instructions (all the software versions are strictly aligned) and tried to run the Go bot with the pretrained v2 model but failed with the msg:
"
RuntimeError: Error(s) in loading state_dict for Model_PolicyValue:
Missing key(s) in state_dict: "init_conv.0.weight", "init_conv.0.bias", "init_conv.1.weight", "init_conv.1.bias", "init_conv.1.running_mean", "init_conv.1.running_var".
Unexpected key(s) in state_dict: "init_conv.module.0.weight", "init_conv.module.0.bias", "init_conv.module.1.weight", "init_conv.module.1.bias", "init_conv.module.1.running_mean", "init_conv.module.1.running_var", "init_conv.module.1.num_batches_tracked".
"
The box is a 24 core x86-64 with a Nvidia GPU V100 / 16GB.
The full log is here and thanks much!
(base) roobot@ELF:~/play-ELF/ELF/scripts/elfgames/go$ ./run.sh /home/roobot/play-ELF/ELF/scripts/elfgames/go/pretrained-go-19x19-v2.bin
Python version: 3.7.1 (default, Dec 14 2018, 19:28:38)
[GCC 7.3.0]
PyTorch version: 1.0.1.post2
CUDA version 10.0.130
Conda env: base
[2019-02-16 22:29:30.383] [rlpytorch.model_loader.load_env0] [info] Loading env
<module 'elfgames.go.game' from '/home/roobot/play-ELF/ELF/src_py/elfgames/go/game.py'> elfgames.go.game
<module 'elfgames.go.df_model3' from '/home/roobot/play-ELF/ELF/src_py/elfgames/go/df_model3.py'> elfgames.go.df_model3
[2019-02-16 22:29:30.394] [rlpytorch.model_loader.load_env0] [info] Parsed options: {'T': 1,
'actor_only': False,
'adam_eps': 0.001,
'additional_labels': ['aug_code', 'move_idx'],
'batchsize': 16,
'batchsize2': -1,
'black_use_policy_network_only': False,
'bn': True,
'bn_eps': 1e-05,
'bn_momentum': 0.1,
'cheat_eval_new_model_wins_half': False,
'cheat_selfplay_random_result': False,
'check_loaded_options': False,
'client_max_delay_sec': 1200,
'comment': '',
'data_aug': -1,
'dim': 256,
'dist_rank': -1,
'dist_url': '',
'dist_world_size': -1,
'dump_record_prefix': '',
'epsilon': 0.0,
'eval_model_pair': '',
'eval_num_games': 400,
'eval_old_model': -1,
'eval_stats': '',
'eval_winrate_thres': 0.55,
'expected_num_clients': -1,
'following_pass': False,
'gpu': 0,
'greedy': True,
'keep_prev_selfplay': False,
'keys_in_reply': ['V', 'rv'],
'leaky_relu': False,
'list_files': [],
'load': '/home/roobot/play-ELF/ELF/scripts/elfgames/go/pretrained-go-19x19-v2.bin',
'load_model_sleep_interval': 0.0,
'loglevel': 'debug',
'lr': 0.001,
'mcts_alpha': 0.0,
'mcts_epsilon': 0.0,
'mcts_persistent_tree': True,
'mcts_pick_method': 'most_visited',
'mcts_puct': 1.5,
'mcts_rollout_per_batch': 16,
'mcts_rollout_per_thread': 8192,
'mcts_root_unexplored_q_zero': False,
'mcts_threads': 2,
'mcts_unexplored_q_zero': False,
'mcts_use_prior': True,
'mcts_verbose': False,
'mcts_verbose_time': True,
'mcts_virtual_loss': 1,
'mode': 'online',
'model': 'online',
'momentum': 0.9,
'move_cutoff': -1,
'multipred_backprop': True,
'num_block': 20,
'num_future_actions': 1,
'num_games': 1,
'num_games_per_thread': -1,
'num_minibatch': 5000,
'num_reader': 50,
'num_reset_ranking': 5000,
'omit_keys': [],
'onload': [],
'opt_method': 'adam',
'parameter_print': False,
'parsed_args': ['df_console.py',
'--mode',
'online',
'--keys_in_reply',
'V',
'rv',
'--use_mcts',
'--mcts_verbose_time',
'--mcts_use_prior',
'--mcts_persistent_tree',
'--load',
'/home/roobot/play-ELF/ELF/scripts/elfgames/go/pretrained-go-19x19-v2.bin',
'--server_addr',
'localhost',
'--port',
'1234',
'--replace_prefix',
'resnet.module,resnet',
'--no_check_loaded_options',
'--no_parameter_print',
'--verbose',
'--gpu',
'0',
'--num_block',
'20',
'--dim',
'256',
'--mcts_puct',
'1.50',
'--batchsize',
'16',
'--mcts_rollout_per_batch',
'16',
'--mcts_threads',
'2',
'--mcts_rollout_per_thread',
'8192',
'--resign_thres',
'0.05',
'--mcts_virtual_loss',
'1',
'--loglevel',
'debug'],
'ply_pass_enabled': 0,
'policy_distri_cutoff': 0,
'policy_distri_training_for_all': False,
'port': 1234,
'preload_sgf': '',
'preload_sgf_move_to': -1,
'print_result': False,
'q_max_size': 1000,
'q_min_size': 10,
'ratio_pre_moves': 0,
'replace_prefix': ['resnet.module,resnet'],
'resign_thres': 0.05,
'sample_nodes': ['pi,a'],
'sample_policy': 'epsilon-greedy',
'selfplay_async': False,
'selfplay_init_num': 2000,
'selfplay_timeout_usec': 0,
'selfplay_update_num': 1000,
'server_addr': 'localhost',
'server_id': '',
'start_ratio_pre_moves': 0.5,
'store_greedy': False,
'suicide_after_n_games': -1,
'use_data_parallel': False,
'use_data_parallel_distributed': False,
'use_df_feature': False,
'use_fp16': False,
'use_mcts': True,
'use_mcts_ai2': False,
'verbose': True,
'weight_decay': 0.0,
'white_mcts_rollout_per_batch': -1,
'white_mcts_rollout_per_thread': -1,
'white_puct': -1.0,
'white_use_policy_network_only': False}
[2019-02-16 22:29:30.396] [rlpytorch.model_loader.load_env0] [info] Finished loading env
[2019-02-16 22:29:30.397] [elf::base::ThreadedDispatcherT-11] [info] Wait all games[1] to register their mailbox
human_actor: {'input': ['s', 'aug_code', 'move_idx'], 'reply': ['pi', 'a', 'V'], 'batchsize': 1}
SharedMem: "human_actor", keys: ['a', 'V', 'pi', 's', 'aug_code', 'move_idx']
a int64_t [16]
V float [16]
pi float [16, 362]
s float [16, 18, 19, 19]
aug_code int32_t [16]
move_idx int32_t [16]
a int64_t [16]
V float [16]
pi float [16, 362]
s float [16, 18, 19, 19]
aug_code int32_t [16]
move_idx int32_t [16]
actor_black: {'input': ['s', 'aug_code', 'move_idx'], 'reply': ['pi', 'V', 'a', 'rv'], 'timeout_usec': 10, 'batchsize': 16}
SharedMem: "actor_black", keys: ['a', 'V', 'rv', 'pi', 's', 'aug_code', 'move_idx']
a int64_t [16]
V float [16]
rv int64_t [16]
pi float [16, 362]
s float [16, 18, 19, 19]
aug_code int32_t [16]
move_idx int32_t [16]
a int64_t [16]
V float [16]
rv int64_t [16]
pi float [16, 362]
s float [16, 18, 19, 19]
aug_code int32_t [16]
move_idx int32_t [16]
[2019-02-16 22:29:34.512] [rlpytorch.model_loader.ModelLoader-1-model_indexNone] [info] Loading model from /home/roobot/play-ELF/ELF/scripts/elfgames/go/pretrained-go-19x19-v2.bin
[2019-02-16 22:29:34.512] [rlpytorch.model_loader.ModelLoader-1-model_indexNone] [info] replace_prefix for state dict: [['resnet.module', 'resnet']]
Traceback (most recent call last):
File "df_console.py", line 87, in
main()
File "df_console.py", line 47, in main
model = model_loader.load_model(GC.params)
File "/home/roobot/play-ELF/ELF/src_py/rlpytorch/model_loader.py", line 161, in load_model
check_loaded_options=self.options.check_loaded_options)
File "/home/roobot/play-ELF/ELF/src_py/rlpytorch/model_base.py", line 147, in load
self.load_state_dict(sd)
File "/home/roobot/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 769, in load_state_dict
self.class.name, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for Model_PolicyValue:
Missing key(s) in state_dict: "init_conv.0.weight", "init_conv.0.bias", "init_conv.1.weight", "init_conv.1.bias", "init_conv.1.running_mean", "init_conv.1.running_var".
Unexpected key(s) in state_dict: "init_conv.module.0.weight", "init_conv.module.0.bias", "init_conv.module.1.weight", "init_conv.module.1.bias", "init_conv.module.1.running_mean", "init_conv.module.1.running_var", "init_conv.module.1.num_batches_tracked".
The text was updated successfully, but these errors were encountered: