Giter Club home page Giter Club logo

alphazero's People

Contributors

agnar22 avatar dilawarm avatar erlingto avatar jostbak avatar joulebit avatar olefredrik1 avatar sebastianaas avatar trer avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

alphazero's Issues

Multiprocessing.py is an unfinished module?

Multiprocessing creates processes with the Train.py module, which has a get_tree procedure. It tries to create the MCTS.MCTS class, but the parameters of the call do not coincide with the MCTS.py file, but it does coincide with the MCTSTraining.py file, where the tree creation algorithm is different.

This is what get_tree looks like from Main.py:

# Creating and returning a tree with properties specified from the input
def get_tree(config, agent, game, dirichlet_noise=True):
    tree = MCTS.MCTS(game, game.get_board(), agent, config)
    return tree

And like this from Train.py:

# Creating and returning a tree with properties specified from the input
def get_tree(config, agent, game, dirichlet_noise=True, seed=0):
    tree = MCTS.MCTS()  # (game, game.get_board(), None, config)
    tree.dirichlet_noise = dirichlet_noise
    tree.NN_input_dim = config.board_dims
    tree.policy_output_dim = config.policy_output_dim
    tree.NN_output_to_moves_func = config.NN_output_to_moves
    tree.move_to_number_func = config.move_to_number
    tree.number_to_move_func = config.number_to_move
    tree.set_evaluation(agent)
    tree.set_game(game)
    # print("setting seed", seed)
    tree.set_seed(seed)
    return tree

This results in the following error:
Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\multiprocessing\process.py", line 315, in _bootstrap
self.run()
File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\multiprocessing\process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "c:\AZ\AlphaZero-CogitoNTNU\Train.py", line 225, in generate_data2
game_generators = [GameGenerator(config1, agent, seed=seeds[i]) for i in range(num_games_each_process)]
File "c:\AZ\AlphaZero-CogitoNTNU\Train.py", line 225, in
game_generators = [GameGenerator(config1, agent, seed=seeds[i]) for i in range(num_games_each_process)]
File "c:\AZ\AlphaZero-CogitoNTNU\Train.py", line 42, in init
self.tree = get_tree(config, agent, self.game, seed=seed)
File "c:\AZ\AlphaZero-CogitoNTNU\Train.py", line 21, in get_tree
tree = MCTS.MCTS() # (game, game.get_board(), None, config)
TypeError: init() missing 4 required positional arguments: 'game', 'start_state', 'agent', and 'Config'

I can't start the Multiprocessing module.

C:\AZ\AlphaZero-CogitoNTNU>python Multiprocessing.py
Traceback (most recent call last):
File "Multiprocessing.py", line 134, in
train(Config, 3000, 8, 500, 600, Config.name)
File "Multiprocessing.py", line 115, in train
x, y_pol, y_val = multiprocess_function(config, num_processes, num_games_each_process, num_search,
File "Multiprocessing.py", line 44, in multiprocess_function
worker.start()
File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\multiprocessing\process.py", line 121, in start
self._popen = self._Popen(self)
File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\multiprocessing\context.py", line 224, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\multiprocessing\context.py", line 326, in _Popen
return Popen(process_obj)
File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\multiprocessing\popen_spawn_win32.py", line 93, in init reduction.dump(process_obj, to_child)
File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\multiprocessing\reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)
TypeError: cannot pickle 'module' object

AZ_MP_Err

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.