pytorch / ELF

ELF: a platform for game research with AlphaGoZero/AlphaZero reimplementation
Other
3.37k stars 567 forks source link

Running python adaptor #102

Open pawni opened 5 years ago

pawni commented 5 years ago

Hi,

I've tried to run the python based environment from scripts/elfgames/adaptor. I tried to run it as game=client model_file=model python server.py but get the following error:

(elf) pawni@host:~/ELF/scripts/elfgames/adaptor$ game=client model_file=model python server.py
3.6.4 |Anaconda custom (64-bit)| (default, Jan 16 2018, 18:10:19)
[GCC 7.2.0]
0.4.1.post2
9.0.176
Conda env: "elf"
Traceback (most recent call last):
  File "server.py", line 58, in <module>
    main()
  File "server.py", line 21, in main
    env = load_env(os.environ, additional_to_load=additional_to_load)
  File "/private/home/pawni/ELF/src_py/rlpytorch/model_loader.py", line 231, in load_env
    game_loader_class = load_module(envs["game"]).Loader
  File "/private/home/pawni/ELF/src_py/rlpytorch/model_loader.py", line 27, in load_module
    module = importlib.import_module(mod)
  File "/private/home/pawni/.conda/envs/elf/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/private/home/pawni/ELF/scripts/elfgames/adaptor/client.py", line 31, in <module>
    sender = EnvWrapper()
  File "/private/home/pawni/ELF/src_py/elf/utils_elf.py", line 549, in __init__
    self.wrapper = elf.EnvSender(opt, net_opt)
TypeError: _elf.EnvSender: No constructor defined!

Am I running it wrong or is there something else?

yuandong-tian commented 5 years ago

@pawni Are you using experimental branch? It is under development now. I will fix it in the next few days so that you can run whatever Python environment and use it in ELF.

pawni commented 5 years ago

Yes, that's on the experimental branch :)

Thanks!