Git Product home page Git Product logo

mugo's People

Contributors

brilee avatar cpeterso avatar prak9 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  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

mugo's Issues

NameError: name 'copy' is not defined

Hello, I am getting an error while trying to run mcts.

tree search
Investigating following position:
   A B C D E F G H J K L M N O P Q R S T   
19 . . . . . . . . . . . . . . . . . . . 19 
18 . . . . . . . . . . . . . . . . . . . 18 
17 . . . . . . . . . . . . . . . . . . . 17 
16 . . . . . . . . . . . . . . . X O<. . 16 
15 . . . . . . . . . . . . . . . . . . . 15 
14 . . . . . . . . . . . . . . . . . . . 14 
13 . . . . . . . . . . . . . . . . . . . 13 
12 . . . . . . . . . . . . . . . . . . . 12 
11 . . . . . . . . . . . . . . . . . . . 11 
10 . . . . . . . . . . . . . . . . . . . 10 
 9 . . . . . . . . . . . . . . . . . . .  9 
 8 . . . . . . . . . . . . . . . . . . .  8 
 7 . . . . . . . . . . . . . . . . . . .  7 
 6 . . . . . . . . . . . . . . . . . . .  6 
 5 . . . . . . . . . . . . . . . . . . .  5 
 4 . . . . . . . . . . . . . . . . . . .  4 
 3 . . . . . . . . . . . . . . . . . . .  3 
 2 . . . . . . . . . . . . . . . . . . .  2 
 1 . . . . . . . . . . . . . . . . . . .  1 
   A B C D E F G H J K L M N O P Q R S T   
Move: 2. Captures X: 0 O: 0

Traceback (most recent call last):
  File "main.py", line 109, in <module>
    argh.dispatch(parser)
  File "/home/mrmartinke/.local/lib/python3.5/site-packages/argh/dispatching.py", line 174, in dispatch
    for line in lines:
  File "/home/mrmartinke/.local/lib/python3.5/site-packages/argh/dispatching.py", line 277, in _execute_command
    for line in result:
  File "/home/mrmartinke/.local/lib/python3.5/site-packages/argh/dispatching.py", line 260, in _call
    result = function(*positional, **keywords)
  File "main.py", line 51, in gtp
    engine_reply = gtp_engine.send(cmd)
  File "/home/mrmartinke/.local/lib/python3.5/site-packages/gtp.py", line 154, in send
    message_id, getattr(self, "cmd_" + command)(arguments))
  File "/home/mrmartinke/.local/lib/python3.5/site-packages/gtp.py", line 222, in cmd_genmove
    move = self._game.get_move(c)
  File "/home/mrmartinke/Desktop/MuGo-master/strategies.py", line 81, in get_move
    move = self.suggest_move(self.position)
  File "/home/mrmartinke/Desktop/MuGo-master/strategies.py", line 236, in suggest_move
    self.tree_search(root)
  File "/home/mrmartinke/Desktop/MuGo-master/strategies.py", line 256, in tree_search
    value = self.estimate_value(root, chosen_leaf)
  File "/home/mrmartinke/Desktop/MuGo-master/strategies.py", line 265, in estimate_value
    current = copy.deepcopy(leaf_position)
NameError: name 'copy' is not defined

same game again and again

Hi there,

Thanks for developing this wonderful tools. But I have a question: when I let Mugo match against itself, the game of each time is exactly same. How to let Mugos play differently?

Thanks again.

What hardware i need to build and develop Mugo.

It's exciting to get MuGo(a personal Alphago) in PCs. Thank your work! I'm interested in your work. I have a pc with Intel I5-4590, 8GB ram, GTX770(1253 cudas). And i have tens of thousand professional SGFs ready to be training. If I want to train 100,000 SGFs with my hardware using Mugo, how long i need training. I learned for Deep Learning hardware GPU is more important than CPUs and High cpu frequency is more important than multi-threads and cores cpu has, is it right? Please give me some advice about hardware configuration. Thank you!

preprocess error: Invalid syntax

Hello,

I downloaded the kgs to the directory ./data, and call the command:
python main.py preprocess ./data/*
Then I have the error:
File "main.py", line 42
def preprocess(*data_sets, processed_dir="./processed_data"):
^
SyntaxError: invalid syntax

It seems there is something wrong with the directory parsing (it doesn't work whether or not I add './' in front of 'processed_data'). Does anyone how to fix it? Thanks!

could you help me to load MuGo in gtp gui like Sabaki?

i load it well in Gogui ,but when i want to load it to vs other ai ,Gogui cant do it well,so i load it in Sabaki,but the parameter seems dont work ,gungo work well in Sabaki,thanks a lot for your help!
here is gogui load
commond:python main.py gtp policy --read-file=tmp\savedmodel
working directory C:\Users\allen\Downloads\MuGo-master\MuGo-master

and here is Sabaki:
working directory C:\Users\allen\Downloads\MuGo-master\MuGo-master\main.py
commond python main.py gtp policy --read-file=C:\Users\allen\Downloads\MuGo-master\MuGo-master\tmp\savedmodel

Error when prepossessing Chinese SGF

When there are Chinese characters in SGF, then I got an error message:

result = function(*positional, **keywords)
File "main.py", line 53, in preprocess
test_dataset = DataSet.from_positions_w_context(test_chunk, is_test=True)
File "C:\Users\xxxx\Mugo\load_data_sets.py", line 83, in from_positions_w_context
positions, next_moves, results = zip(*positions_w_context)
ValueError: not enough values to unpack (expected 3, got 0)

handicap=int(sgf_prop(props.get('HA', [0]))) ValueError: invalid literal for int() with base 10: '吴受先'

when i run "python3 main.py preprocess data/other/tmp/wuqingyuan/" get this error info:
366 sgfs found.
Estimated number of chunks: 17
Traceback (most recent call last):
File "main.py", line 94, in
argh.dispatch(parser)
File "/usr/local/lib/python3.5/dist-packages/argh/dispatching.py", line 174, in dispatch
for line in lines:
File "/usr/local/lib/python3.5/dist-packages/argh/dispatching.py", line 277, in _execute_command
for line in result:
File "/usr/local/lib/python3.5/dist-packages/argh/dispatching.py", line 260, in _call
result = function(*positional, **keywords)
File "main.py", line 49, in preprocess
test_chunk, training_chunks = parse_data_sets(*data_sets)
File "/mnt/ken-volume/MuGo/load_data_sets.py", line 140, in parse_data_sets
test_chunk, training_chunks = split_test_training(positions_w_context, est_num_positions)
File "/mnt/ken-volume/MuGo/load_data_sets.py", line 60, in split_test_training
positions_w_context = list(positions_w_context)
File "/mnt/ken-volume/MuGo/load_data_sets.py", line 52, in get_positions_from_sgf
for position_w_context in replay_sgf(f.read()):
File "/mnt/ken-volume/MuGo/sgf_wrapper.py", line 124, in replay_sgf
handicap=int(sgf_prop(props.get('HA', [0]))),
ValueError: invalid literal for int() with base 10: '吴受先'

it's look same sgf file props.ge('HA',[0]) get a string ,not a int.

max rollout depth exceeded! import copy rasied it ?

when i want to use mtcs to play ,it rasied error :
File "/home/mrmartinke/Desktop/MuGo-master/strategies.py", line 265, in estimate_value
current = copy.deepcopy(leaf_position)
NameError: name 'copy' is not defined
so i import copy ,the game can run ,but it rasied this everytime :

Move: 4. Captures X: 0 O: 0
max rollout depth exceeded!
value: 23.0
tree search
thanks for your help!

AttributeError: 'PolicyNetwork' object has no attribute 'output'

3 play black D5
=3

4 genmove white
Traceback (most recent call last):
File "main.py", line 109, in
argh.dispatch(parser)
File "D:\Python\lib\site-packages\argh\dispatching.py", line 174, in dispatch
for line in lines:
File "D:\Python\lib\site-packages\argh\dispatching.py", line 277, in _execute_command
for line in result:
File "D:\Python\lib\site-packages\argh\dispatching.py", line 260, in call
result = function(*positional, **keywords)
File "main.py", line 51, in gtp
engine_reply = gtp_engine.send(cmd)
File "D:\Python\lib\site-packages\gtp.py", line 154, in send
message_id, getattr(self, "cmd
" + command)(arguments))
File "D:\Python\lib\site-packages\gtp.py", line 222, in cmd_genmove
move = self._game.get_move(c)
File "D:\MuGo-master\MuGo-master\strategies.py", line 81, in get_move
move = self.suggest_move(self.position)
File "D:\MuGo-master\MuGo-master\strategies.py", line 115, in suggest_move
move_probabilities = self.policy_network.run(position)
File "D:\MuGo-master\MuGo-master\policy.py", line 152, in run
probabilities = self.session.run(self.output, feed_dict={self.x: processed_position[None, :]})[0]
AttributeError: 'PolicyNetwork' object has no attribute 'output'

ImportError: No module named 'argh'

$ sudo -H pip install argh
Requirement already satisfied: argh in /usr/local/lib/python2.7/dist-packages

Then:

$ python3 main.py preprocess games/*
Traceback (most recent call last):
  File "main.py", line 2, in <module>
    import argh
ImportError: No module named 'argh'

Using 64-bit Xubuntu Linux:

$ python3 --version
Python 3.5.2

Training failed, has no attribute 'mul'

(tf3.4) cong@jsjc-PowerEdge-T630:~/Downloads/MuGo$ python main.py train processed_data --save-file=tmp/savedmodel1 --epochs=1 --logdir=logs/my_training_run
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE3 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.
Traceback (most recent call last):
File "main.py", line 94, in
argh.dispatch(parser)
File "/home/cong/anaconda3/envs/tf3.4/lib/python3.4/site-packages/argh/dispatching.py", line 174, in dispatch
for line in lines:
File "/home/cong/anaconda3/envs/tf3.4/lib/python3.4/site-packages/argh/dispatching.py", line 277, in _execute_command
for line in result:
File "/home/cong/anaconda3/envs/tf3.4/lib/python3.4/site-packages/argh/dispatching.py", line 260, in _call
result = function(*positional, **keywords)
File "main.py", line 72, in train
n = PolicyNetwork()
File "/home/cong/Downloads/MuGo/policy.py", line 49, in init
self.set_up_network()
File "/home/cong/Downloads/MuGo/policy.py", line 90, in set_up_network
log_likelihood_cost = -tf.reduce_mean(tf.reduce_sum(tf.mul(tf.log(output), y), reduction_indices=[1]))
AttributeError: 'module' object has no attribute 'mul'

I am sure that preprocessing work is done, and trunk files are stored at processed_data.
I use ubuntu 14.04 LTS, anaconda environment, python3.4. argh,sfg has been in the 'conda list' result.

TypeError: <lambda>() missing 1 required positional argument: 'root'

tree search
Investigating following position:
   A B C D E F G H J K L M N O P Q R S T   
19 . . . . . . . . . . . . . . . . . . . 19 
18 . . . . . . . . . . . . . . . . . . . 18 
17 . . . . . . . . . . . . . . . . . . . 17 
16 . . . . . . . . . . . . . . . O<. . . 16 
15 . . . . . . . . . . . . . . . . . . . 15 
14 . . . . . . . . . . . . . . . . . . . 14 
13 . . . . . . . . . . . . . . . . . . . 13 
12 . . . . . . . . . . . . . . . . . . . 12 
11 . . . . . . . . . . . . . . . . . . . 11 
10 . . . . . . . . . . . . . . . . . . . 10 
 9 . . . . . . . X . . . . . . . . . . .  9 
 8 . . . . . . . . . . . . . . . . . . .  8 
 7 . . . . . . . . . . . . . . . . . . .  7 
 6 . . . . . . . . . . . . . . . . . . .  6 
 5 . . . . . . . . . . . . . . . . . . .  5 
 4 . . . . . . . . . . . . . . . . . . .  4 
 3 . . . . . . . . . . . . . . . . . . .  3 
 2 . . . . . . . . . . . . . . . . . . .  2 
 1 . . . . . . . . . . . . . . . . . . .  1 
   A B C D E F G H J K L M N O P Q R S T   
Move: 2. Captures X: 0 O: 0

max rollout depth exceeded!
value: -54.5
tree search
Investigating following position:
   A B C D E F G H J K L M N O P Q R S T   
19 . . . . . . . . . . . . . . . . . . . 19 
18 . . . . . . . . . . . . . . . . . . . 18 
17 . . . . . . . . . . . . . . . . . . . 17 
16 . . . . . . . . . . . . . . . . O<. . 16 
15 . . . . . . . . . . . . . . . . . . . 15 
14 . . . . . . . . . . . . . . . . . . . 14 
13 . . . . . . . . . . . . . . . . . . . 13 
12 . . . . . . . . . . . . . . . . . . . 12 
11 . . . . . . . . . . . . . . . . . . . 11 
10 . . . . . . . . . . . . . . . . . . . 10 
 9 . . . . . . . X . . . . . . . . . . .  9 
 8 . . . . . . . . . . . . . . . . . . .  8 
 7 . . . . . . . . . . . . . . . . . . .  7 
 6 . . . . . . . . . . . . . . . . . . .  6 
 5 . . . . . . . . . . . . . . . . . . .  5 
 4 . . . . . . . . . . . . . . . . . . .  4 
 3 . . . . . . . . . . . . . . . . . . .  3 
 2 . . . . . . . . . . . . . . . . . . .  2 
 1 . . . . . . . . . . . . . . . . . . .  1 
   A B C D E F G H J K L M N O P Q R S T   
Move: 2. Captures X: 0 O: 0

max rollout depth exceeded!
value: 33.5
tree search
Investigating following position:
   A B C D E F G H J K L M N O P Q R S T   
19 . . . . . . . . . . . . . . . . . . . 19 
18 . . . . . . . . . . . . . . . . . . . 18 
17 . . . . . . . . . . . . . . . . . . . 17 
16 . . . . . . . . . . . . . . . . O . . 16 
15 . . . . . . . . . . . . . . . . . . . 15 
14 . . . . . . . . . . . . . . . . . . . 14 
13 . . . . . . . . . . . . . . . . . . . 13 
12 . . . . . . . . . . . . . . . . . . . 12 
11 . . . . . . . . . . . . . . . . . . . 11 
10 . . . . . . . . . . . . . . . . . . . 10 
 9 . . . . . . . X . . . . . . . . . . .  9 
 8 . . . . . . . . . . . . . . . . . . .  8 
 7 . . . . . . . . . . . . . . . . . . .  7 
 6 . . . . . . . . . . . . . . . . . . .  6 
 5 . . . . . . . . . . . . . . . . . . .  5 
 4 . . . X<. . . . . . . . . . . . . . .  4 
 3 . . . . . . . . . . . . . . . . . . .  3 
 2 . . . . . . . . . . . . . . . . . . .  2 
 1 . . . . . . . . . . . . . . . . . . .  1 
   A B C D E F G H J K L M N O P Q R S T   
Move: 3. Captures X: 0 O: 0

max rollout depth exceeded!
value: -33.5
tree search
Investigating following position:
   A B C D E F G H J K L M N O P Q R S T   
19 . . . . . . . . . . . . . . . . . . . 19 
18 . . . . . . . . . . . . . . . . . . . 18 
17 . . . . . . . . . . . . . . . . . . . 17 
16 . . . X<. . . . . . . . . . . . O . . 16 
15 . . . . . . . . . . . . . . . . . . . 15 
14 . . . . . . . . . . . . . . . . . . . 14 
13 . . . . . . . . . . . . . . . . . . . 13 
12 . . . . . . . . . . . . . . . . . . . 12 
11 . . . . . . . . . . . . . . . . . . . 11 
10 . . . . . . . . . . . . . . . . . . . 10 
 9 . . . . . . . X . . . . . . . . . . .  9 
 8 . . . . . . . . . . . . . . . . . . .  8 
 7 . . . . . . . . . . . . . . . . . . .  7 
 6 . . . . . . . . . . . . . . . . . . .  6 
 5 . . . . . . . . . . . . . . . . . . .  5 
 4 . . . . . . . . . . . . . . . . . . .  4 
 3 . . . . . . . . . . . . . . . . . . .  3 
 2 . . . . . . . . . . . . . . . . . . .  2 
 1 . . . . . . . . . . . . . . . . . . .  1 
   A B C D E F G H J K L M N O P Q R S T   
Move: 3. Captures X: 0 O: 0

value: -46.5
Traceback (most recent call last):
  File "main.py", line 109, in <module>
    argh.dispatch(parser)
  File "/home/mrmartinke/.local/lib/python3.5/site-packages/argh/dispatching.py", line 174, in dispatch
    for line in lines:
  File "/home/mrmartinke/.local/lib/python3.5/site-packages/argh/dispatching.py", line 277, in _execute_command
    for line in result:
  File "/home/mrmartinke/.local/lib/python3.5/site-packages/argh/dispatching.py", line 260, in _call
    result = function(*positional, **keywords)
  File "main.py", line 51, in gtp
    engine_reply = gtp_engine.send(cmd)
  File "/usr/local/lib/python3.5/dist-packages/gtp.py", line 154, in send
    message_id, getattr(self, "cmd_" + command)(arguments))
  File "/usr/local/lib/python3.5/dist-packages/gtp.py", line 222, in cmd_genmove
    move = self._game.get_move(c)
  File "/home/mrmartinke/Desktop/MuGo-master/strategies.py", line 85, in get_move
    move = self.suggest_move(self.position)
  File "/home/mrmartinke/Desktop/MuGo-master/strategies.py", line 243, in suggest_move
    return max(root.children.keys(), key=lambda move, root: root.children[move])
TypeError: <lambda>() missing 1 required positional argument: 'root'

what the "capture size" means?

I read your paper, I don't understand Capture Size, if at state S(t), we get a result A(t), is the Capture size the result of the move A(t) ? or the result of move A(t-1)? and about liberties after move, is it the same as capture size? thanks.

SelfPlay Illegal Move

Traceback (most recent call last):
File "selfplay.py", line 43, in
winners, losers = extract_moves(positions)
File "selfplay.py", line 32, in extract_moves
sgf_wrapper.replay_position(final_position))
File "/home/mrmartinke/Desktop/MuGo-master/utils.py", line 67, in take_n
return list(itertools.islice(iterable, n))
File "/home/mrmartinke/Desktop/MuGo-master/sgf_wrapper.py", line 174, in replay_position
pos = pos.play_move(next_move, color=color)
File "/home/mrmartinke/Desktop/MuGo-master/go.py", line 354, in play_move
raise IllegalMove("Move at {} is illegal: \n{}".format(c, self))
go.IllegalMove: Move at (16, 1) is illegal:

Group ID overflowed

When using mcts, the program crashed and returned KeyError: -32768 in function _update_liberties group = self.groups[group_id]. Is this a bug of code?

Error when start training

python main.py train processed_data/ --save-file=/tmp/savedmodel --epochs=1 --logdir=logs/my_training_run

untitled

MCTS error

Plicy works fine.
C:\MuGo>python main.py gtp policy --read-file=model\savedmodel
GTP engine ready
genmove b (I type)
= Q16

MCTS does not work. Error messages as below.
C:\MuGo>python main.py gtp mcts --read-file=model\savedmodel
GTP engine ready
genmove b (I type)
tree search
Traceback (most recent call last):
File "main.py", line 94, in
argh.dispatch(parser)
File "c:\python35\lib\site-packages\argh\dispatching.py", line 174, in dispatch
for line in lines:
File "c:\python35\lib\site-packages\argh\dispatching.py", line 277, in _execute_command
for line in result:
File "c:\python35\lib\site-packages\argh\dispatching.py", line 260, in _call
result = function(*positional, **keywords)
File "main.py", line 40, in gtp
engine_reply = gtp_engine.send(cmd)
File "c:\python35\lib\site-packages\pygtp-0.2-py3.5.egg\gtp.py", line 154, in send
File "c:\python35\lib\site-packages\pygtp-0.2-py3.5.egg\gtp.py", line 222, in cmd_genmove
File "C:\MuGo\strategies.py", line 81, in get_move
move = self.suggest_move(self.position)
File "C:\MuGo\strategies.py", line 236, in suggest_move
self.tree_search(root)
File "C:\MuGo\strategies.py", line 246, in tree_search
position = chosen_leaf.compute_position()
File "C:\MuGo\strategies.py", line 183, in compute_position
self.position = self.parent.position.play_move(self.move)
TypeError: play_move() missing 1 required positional argument: 'c'

tensorflow.python.framework.errors_impl.NotFoundError: Key RL_global_step not found in checkpoint

tensorflow version: 1.3 (CPU)
When I run : python main.py gtp policy --read-file=saved_models/20170718

It causes an error:
tensorflow.python.framework.errors_impl.NotFoundError: Key RL_global_step not fo
und in checkpoint
[[Node: save/RestoreV2 = RestoreV2[dtypes=[DT_INT32], _device="/job:loc
alhost/replica:0/task:0/cpu:0"](_arg_save/Const_0_0, save/RestoreV2/tensor_names
, save/RestoreV2/shape_and_slices)]]
How to fix it.

NameError: name 'find_sgf_files' is not defined

Traceback (most recent call last):
File "main.py", line 103, in
argh.dispatch(parser)
File "C:\Users\LEO\AppData\Local\Programs\Python\Python35\lib\site-packages\ar
for line in lines:
File "C:\Users\LEO\AppData\Local\Programs\Python\Python35\lib\site-packages\ar
for line in result:
File "C:\Users\LEO\AppData\Local\Programs\Python\Python35\lib\site-packages\ar
result = function(*positional, **keywords)
File "main.py", line 49, in preprocess
sgf_files = list(find_sgf_files(*data_sets))
NameError: name 'find_sgf_files' is not defined

Error while prerunning it

[del]I did install things included in the 'requirements.txt'.
But it seems didn't work when I commanded 'python main.py gtp policy --read-file=saved_models/20170718'.

File "main.py", line 44
def preprocess(*data_sets, processed_dir="processed_data"):
^
The '^' is pointing to the last letter of 'processed_dir'.
SyntaxError: invalid syntax

I tried to solve it but just not worked.
And need your help.

Thanks.[/del]

It's okay. I solved it.
Marvellous work. Thanks again.

SelfPlay Illegal Move

here is traceback,i will be grateful if you can help me!
Traceback (most recent call last):
File "C:/Users/allen/Downloads/TaDing-MuGo-master/MuGo/selfplay.py", line 43, in
winners, losers = extract_moves(positions)
File "C:/Users/allen/Downloads/TaDing-MuGo-master/MuGo/selfplay.py", line 32, in extract_moves
sgf_wrapper.replay_position(final_position))
File "C:\Users\allen\Downloads\TaDing-MuGo-master\MuGo\utils.py", line 67, in take_n
return list(itertools.islice(iterable, n))
File "C:\Users\allen\Downloads\TaDing-MuGo-master\MuGo\sgf_wrapper.py", line 174, in replay_position
pos = pos.play_move(next_move, color=color)
File "C:\Users\allen\Downloads\TaDing-MuGo-master\MuGo\go.py", line 354, in play_move
raise IllegalMove("Move at {} is illegal: \n{}".format(c, self))
go.IllegalMove: Move at (7, 18) is illegal:
A B C D E F G H J K L M N O P Q R S T
19 . . . . . . . . . . . . . . . . . . . 19
18 . . . O . . . X . . . . . . X . . . . 18
17 . . X . . O . O O . . X X X O X X X . 17
16 . . . X . . . . . . . X O O O O O X . 16
15 . . . . . . . . . . X O X X X<O O O O 15
14 . . X . . . . . . . . O . . X O X X O 14
13 . . . . . . . . . . O . . X X O O X X 13
12 . . . . . . . . . . X X X . X X O X . 12
11 . . . . . . . . . X O O . X O O X X O 11
10 . . . . . . . . . . X O O O O O O X O 10
9 . . . . . . . . . . . X . . O X X X O 9
8 . . . . . . . . . . X . O X O X O O . 8
7 . . O . . . . . . . . . X O X X O X . 7
6 . O X . . . . . . . . . O O O O O . . 6
5 . O X O O . . . . O . . . . . . . O . 5
4 . . O X . X . . . . . . O X . X . X . 4
3 . O O X . O X . . . . . . X . . . . . 3
2 . O X X . . . . . . . X . . . . . . . 2
1 . X . . . . . . . . . . . . . . . . . 1
A B C D E F G H J K L M N O P Q R S T
Move: 122. Captures X: 0 O: 1

Process finished with exit code 1

preprocess error

Nice project! unfortunately i encountered an error and am not sure what goes wrong.
I downloaded the master branch yesterday.
the command i use: python main.py preprocess data/*
python version 3.5 ( tested 3.4 )

somehow 0 positions are allocated as test but i can't find out why

124966 sgfs found. Estimated number of chunks: 6101 Allocating 0 positions as test; remainder as training Writing test chunk Traceback (most recent call last): File "main.py", line 79, in <module> argh.dispatch(parser) File "/home/boss/anaconda3/envs/tensorflow35/lib/python3.5/site-packages/argh/dispatching.py", line 174, in dispatch for line in lines: File "/home/boss/anaconda3/envs/tensorflow35/lib/python3.5/site-packages/argh/dispatching.py", line 277, in _execute_command for line in result: File "/home/boss/anaconda3/envs/tensorflow35/lib/python3.5/site-packages/argh/dispatching.py", line 260, in _call result = function(*positional, **keywords) File "main.py", line 45, in preprocess process_raw_data(*data_sets, processed_dir=processed_dir) File "/home/boss/Downloads/CNN-Play/MuGo-master/load_data_sets.py", line 154, in process_raw_data test_dataset = DataSet.from_positions_w_context(test_chunk, is_test=True) File "/home/boss/Downloads/CNN-Play/MuGo-master/load_data_sets.py", line 106, in from_positions_w_context positions, next_moves, results = zip(*positions_w_context) ValueError: not enough values to unpack (expected 3, got 0)

reverted the "rewrite onehot methods for small improvement" commit, error message:
ValueError: need more than 0 values to unpack

AttributeError: module 'gtp' has no attribute 'RESIGN'

error info when run "gogui-twogtp -black 'python3 main.py gtp policy --read-file=./tmp/savedmodel' -white 'gogui-display' -size 19 -komi 7.5 -verbose -auto":

B>> genmove b
Traceback (most recent call last):
File "main.py", line 81, in
argh.dispatch(parser)
File "/usr/local/lib/python3.5/dist-packages/argh/dispatching.py", line 174, in dispatch
for line in lines:
File "/usr/local/lib/python3.5/dist-packages/argh/dispatching.py", line 277, in _execute_command
for line in result:
File "/usr/local/lib/python3.5/dist-packages/argh/dispatching.py", line 260, in call
result = function(*positional, **keywords)
File "main.py", line 38, in gtp
engine_reply = gtp_engine.send(cmd)
File "/usr/local/lib/python3.5/dist-packages/gtp.py", line 151, in send
message_id, getattr(self, "cmd
" + command)(arguments))
File "/usr/local/lib/python3.5/dist-packages/gtp.py", line 219, in cmd_genmove
move = self._game.get_move(c)
File "/mnt/ken-volume/MuGo/strategies.py", line 60, in get_move
return utils.unparse_pygtp_coords(move)
File "/mnt/ken-volume/MuGo/utils.py", line 41, in unparse_pygtp_coords
if c == gtp.RESIGN:
AttributeError: module 'gtp' has no attribute 'RESIGN'
B>> final_score
W>> final_score
W<< ? unknown command: final_score
W<<
B>> quit
W>> quit
W<< =
W<<
Black program died

system :ubuntu 16.04

SyntaxError: invalid syntax

$ python main.py preprocess games/*
  File "main.py", line 42
    def preprocess(*data_sets, processed_dir="processed_data"):
                                           ^
SyntaxError: invalid syntax

Using:

$ python --version
Python 2.7.12

About how to play MuGo

At running
python main.py gtp policy --read-file=saved_models/20170718'
it appeared that
AttributeError: module 'gtp' has no attribute 'Engine' .

Besides, when I ran the code
`gogui-twogtp -black 'python main.py gtp policy --read-file=saved_models/20170718' -white 'gogui-display'-size 19 -komi 7.5 -verbose -auto
in cmd it will be
Unknown option --read-file=saved_models/20170718'

I will appreciate it if anyone could help me!

Is the rollout fastNet implemented?

Hello, really nice work. Is the rollout fastNet implemented? I see in the code that it's simply replaced by the full policy net. Why not use a fast rollout net as said in the paper?

MCTS does not work

python main.py gtp policy --read-file=tmp\savedmodel This command is OK
python main.py mcts policy --read-file=tmp\savedmodel not work
fix the bug.Thank you

AttributeError: 'NoneType' object has no attribute 'to_play'

when run "python3 main.py preprocess data/other/tmp/" i get this error info:
3 sgfs found.
Estimated number of chunks: 0
Traceback (most recent call last):
File "main.py", line 94, in
argh.dispatch(parser)
File "/usr/local/lib/python3.5/dist-packages/argh/dispatching.py", line 174, in dispatch
for line in lines:
File "/usr/local/lib/python3.5/dist-packages/argh/dispatching.py", line 277, in _execute_command
for line in result:
File "/usr/local/lib/python3.5/dist-packages/argh/dispatching.py", line 260, in _call
result = function(*positional, **keywords)
File "main.py", line 49, in preprocess
test_chunk, training_chunks = parse_data_sets(*data_sets)
File "/mnt/ken-volume/MuGo/load_data_sets.py", line 140, in parse_data_sets
test_chunk, training_chunks = split_test_training(positions_w_context, est_num_positions)
File "/mnt/ken-volume/MuGo/load_data_sets.py", line 60, in split_test_training
positions_w_context = list(positions_w_context)
File "/mnt/ken-volume/MuGo/load_data_sets.py", line 52, in get_positions_from_sgf
for position_w_context in replay_sgf(f.read()):
File "/mnt/ken-volume/MuGo/sgf_wrapper.py", line 133, in replay_sgf
maybe_correct_next(pos, current_node.next)
File "/mnt/ken-volume/MuGo/sgf_wrapper.py", line 97, in maybe_correct_next
('W' in next_node.properties and not pos.to_play == go.WHITE)):
AttributeError: 'NoneType' object has no attribute 'to_play'

About how to fix argument problem.

At running
gogui-twogtp -black 'python3 main.py gtp policy --read -file=/tmp/' -white 'gogui-display' -size 19 -komi 7.5 -verbose -auto
there is a argument problem.
main.py gtp: error: argument -r/--read-file: expected one argument
i don't know where the argument should be.
if anyone konw it,please help me.i will appreciate it very much.

Type of self.output in policy.py

Hey @brilee ,

I'm trying to play against this wonderful library. However when I'm trying genmove b I'm getting:

File "\MuGo\policy.py", line 152, in run
probabilities = self.session.run(self.output, feed_dict={self.x: processed_position[None, :]})[0]
AttributeError: 'PolicyNetwork' object has no attribute 'output'

What should self.output be ?

IllegalMove

When I connect the robot to CGBAN,
It often says IllegalMove
and ended the program

I think the problem is the Go Rule,
But what Rule the Mugo use (Chinese? Japanese?)?

NameError: name 'protocol_version' is not defined

I run this program by using:
gogui-twogtp -black 'python main.py gtp policy --read-file=/tmp/savedmodel' -white 'gogui-display' -size 19 -komi 7.5 -verbose -auto

My machine meets all those requirements (gtp....);
and the Error goes here:
GTP engine ready
Traceback (most recent call last):
File "main.py", line 94, in
argh.dispatch(parser)
File "/usr/local/lib/python2.7/site-packages/argh/dispatching.py", line 174, in dispatch
for line in lines:
File "/usr/local/lib/python2.7/site-packages/argh/dispatching.py", line 277, in _execute_command
for line in result:
File "/usr/local/lib/python2.7/site-packages/argh/dispatching.py", line 260, in _call
result = function(*positional, **keywords)
File "main.py", line 31, in gtp
inpt = input()
File "", line 1, in
NameError: name 'protocol_version' is not defined
B>> name
B>> version
B>> list_commands
The Go program terminated unexpectedly.

AttributeError: 'PolicyNetwork' object has no attribute 'output'

Hello, I am getting this error while trying to generate a move.

Traceback (most recent call last):
  File "main.py", line 109, in <module>
    argh.dispatch(parser)
  File "/home/mrmartinke/.local/lib/python3.5/site-packages/argh/dispatching.py", line 174, in dispatch
    for line in lines:
  File "/home/mrmartinke/.local/lib/python3.5/site-packages/argh/dispatching.py", line 277, in _execute_command
    for line in result:
  File "/home/mrmartinke/.local/lib/python3.5/site-packages/argh/dispatching.py", line 260, in _call
    result = function(*positional, **keywords)
  File "main.py", line 51, in gtp
    engine_reply = gtp_engine.send(cmd)
  File "/usr/local/lib/python3.5/dist-packages/gtp.py", line 154, in send
    message_id, getattr(self, "cmd_" + command)(arguments))
  File "/usr/local/lib/python3.5/dist-packages/gtp.py", line 222, in cmd_genmove
    move = self._game.get_move(c)
  File "/home/mrmartinke/Desktop/MuGo-master/strategies.py", line 81, in get_move
    move = self.suggest_move(self.position)
  File "/home/mrmartinke/Desktop/MuGo-master/strategies.py", line 233, in suggest_move
    move_probs = self.policy_network.run(position)
  File "/home/mrmartinke/Desktop/MuGo-master/policy.py", line 152, in run
    probabilities = self.session.run(self.output, feed_dict={self.x: processed_position[None, :]})[0]
AttributeError: 'PolicyNetwork' object has no attribute 'output'

Move "Q16" from engine is not a legal move (ko rule violation).

Hey, could you mabye add a check for the ko rule?

tree search
Investigating following position:
   A B C D E F G H J K L M N O P Q R S T   
19 . . . . . . . . . . . . . . . . . . . 19 
18 . . . . . . . . . . . . . . . X . . . 18 
17 . . . . . . . . . . . . . X . X X . . 17 
16 . . X . . . . . . . . . . . X O<X . . 16 
15 . . . . . . . . . . . . . . O * O O . 15 
14 . . . . . . . . . . . . . . . O X . . 14 
13 . . . . . . . . . . . . . . . O X X X 13 
12 . . . . . . . . . . . . . . . . O O . 12 
11 . . . . . . . . . . . . . . . . . . . 11 
10 . . . . . . . . . . . . . . . . . . . 10 
 9 . . . . . . . . . . . . . . . . . . .  9 
 8 . . . . . . . . . . . . . . . . O . .  8 
 7 . . . . . . . . . . . . . . . . . . .  7 
 6 . . X . . . . . . . . . . . . . X . .  6 
 5 . . . . . . . . . . . . . . . . . . .  5 
 4 . . . O . O . . . . . . . O . O . . .  4 
 3 . . . . . X O . . . . O . X . . . . .  3 
 2 . . . . . . . . . . . . . . . . . . .  2 
 1 . . . . . . . . . . . . . . . . . . .  1 
   A B C D E F G H J K L M N O P Q R S T   
Move: 32. Captures X: 1 O: 1

max rollout depth exceeded!
value: 4.5
tree search
Investigating following position:
   A B C D E F G H J K L M N O P Q R S T   
19 . . . . . . . . . . . . . . . . . . . 19 
18 . . . . . . . . . . . . . . . X . . . 18 
17 . . . . . . . . . . . . . X . X X . . 17 
16 . . X . . . . . . . . . . . X * X . . 16 
15 . . . . . . . . . . . . . . O X<O O . 15 
14 . . . . . . . . . . . . . . . O X . . 14 
13 . . . . . . . . . . . . . . . O X X X 13 
12 . . . . . . . . . . . . . . . . O O . 12 
11 . . . . . . . . . . . . . . . . . . . 11 
10 . . . . . . . . . . . . . . . . . . . 10 
 9 . . . . . . . . . . . . . . . . . . .  9 
 8 . . . . . . . . . . . . . . . . O . .  8 
 7 . . . . . . . . . . . . . . . . . . .  7 
 6 . . X . . . . . . . . . . . . . X . .  6 
 5 . . . . . . . . . . . . . . . . . . .  5 
 4 . . . O . O . . . . . . . O . O . . .  4 
 3 . . . . . X O . . . . O . X . . . . .  3 
 2 . . . . . . . . . . . . . . . . . . .  2 
 1 . . . . . . . . . . . . . . . . . . .  1 
   A B C D E F G H J K L M N O P Q R S T   
Move: 33. Captures X: 2 O: 1

max rollout depth exceeded!
value: -4.5
Jun 29, 2017 7:55:35 PM com.gokgs.client.gtp.GtpClient protocolEvent
SEVERE: Error from GTP Communications layer, closing down.
org.igoweb.go.gtp.GtpException: Move "Q16" from engine is not a legal move (ko rule violation).

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.