toybox-rs / Toybox

The Machine Learning Toybox for testing the behavior of autonomous agents.
http://toybox.rs
27 stars 12 forks source link

Gym doesn't recognize the environment type as 'atari' #143

Closed kclary closed 4 years ago

kclary commented 4 years ago

Results in this error:


PYTHONPATH /Users/kclary/dev/toybox/ctoybox/baselines:/Users/kclary/dev/toybox/ctoybox/toybox:
LD_LIBRARY_PATH :/Users/kclary/dev/toybox/ctoybox/../target/release
LIBCTOYBOX /Users/kclary/dev/toybox/ctoybox/..
Global setup not found...trying local development install...
Looking for toybox lib in
    /Users/kclary/dev/toybox/ctoybox/../target/debug/libctoybox.dylib
or
    /Users/kclary/dev/toybox/ctoybox/../target/release/libctoybox.dylib
/Users/kclary/dev/toybox/ctoybox/../target/release/libctoybox.dylib
Registered Toybox environments with gym.
Logging to /var/folders/hm/yd8cl6vd1bjbv3sjvd_nrrcc0000gr/T/openai-2019-11-22-15-45-48-158540
Logging to /var/folders/hm/yd8cl6vd1bjbv3sjvd_nrrcc0000gr/T/openai-2019-11-22-15-45-48-345041
env_type: mujoco
Traceback (most recent call last):
  File "//anaconda/lib/python3.5/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "//anaconda/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/Users/kclary/dev/toybox/ctoybox/baselines/baselines/run.py", line 253, in <module>
    main()
  File "/Users/kclary/dev/toybox/ctoybox/baselines/baselines/run.py", line 200, in main
    model, env = train(args, extra_args)
  File "/Users/kclary/dev/toybox/ctoybox/baselines/baselines/run.py", line 76, in train
    env = build_env(args, extra_args)
  File "/Users/kclary/dev/toybox/ctoybox/baselines/baselines/run.py", line 126, in build_env
    return env
UnboundLocalError: local variable 'env' referenced before assignment```
kclary commented 4 years ago

Something is broken and it's setting the environment to Reacher-v2 (the default), which is a mujoco env

kclary commented 4 years ago

I am no longer getting this error (with no changes) but @etosch still is

kclary commented 4 years ago

Working command for me is: ./start_python -m baselines.run --alg=a2c --env=AmidarToyboxNoFrameskip-v4 --num_timesteps=0 --num_env=1 --load_path=path/to/model.model --play

etosch commented 4 years ago

New setup; can't reproduce.

Can run successfully following current (https://github.com/toybox-rs/Toybox/commit/eb5fae1291ae92ea07ff6250cbfa3625f8bb016c) README instructions and the command to set up a virtual environment: python -m baselines.run --alg=ppo2 --env=AmidarToyboxNoFrameskip-v4 --num_timesteps=0 --num_env=1 --load_path=models/AmidarToyboxNoFrameskip-v4.regress.model --play