doas3140 / PyStack

Python implementation of Deepstack
79 stars 34 forks source link

MemoryError #2

Open 154461013 opened 5 years ago

154461013 commented 5 years ago

generate_data.py --street 1 --approximate root_nodes in PyStack\src\NeuralNetwork\next_round_value.py function _init_root_approximation_vars() self.next_round_inputs = np.zeros([batch_size,BC,HC*PC + 1 + self.num_board_features], dtype=dt) self.next_round_values = np.zeros([batch_size,BC,PC,HC], dtype=dt) what is the batch_size?So next_round_inputs requires 22GB of memory。Do I need more than 60g of memory?

ZM-CASIA commented 5 years ago

python generate_data.py --street 1 --approximate root_nodes

Traceback (most recent call last): File "generate_data.py", line 29, in main() File "generate_data.py", line 25, in main data_generation.generate_data(street, approximate, starting_idx) File "/home/zhangmeng/pystack/src/DataGeneration/data_generation.py", line 170, in generate_data inputs, targets = self.solve_root_node(board, batch_size) File "/home/zhangmeng/pystack/src/DataGeneration/data_generation.py", line 46, in solve_root_node self.range_generator.set_board(hand_strengths, board) File "/home/zhangmeng/pystack/src/DataGeneration/range_generator.py", line 59, in set_board hand_strengths = evaluator.evaluate_board(board) if board.shape[0] == 5 else handstrengths IndexError: tuple index out of range @doas3140 when generating the data of pre-flop, it failed. ^^??

154461013 commented 5 years ago

if board.shape[0] == 5,You need to modify this 。when in pre_flop, the shape is None.

ZM-CASIA commented 5 years ago

for street in [turn, flop, pre-flop]: data = generate_data(street, root_nodes_nn[street]) # solve leaf nodes tf_data = convert_to_tf_data(data) street_leaf_nn = train_neural_network(tf_data)

Do we really need to run the street in "pre-flop"??