Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sequence for key observ is of unexpected type object #14

Open
daliel opened this issue Sep 10, 2021 · 0 comments
Open

Sequence for key observ is of unexpected type object #14

daliel opened this issue Sep 10, 2021 · 0 comments

Comments

@daliel
Copy link

daliel commented Sep 10, 2021

I wrote my env. my env returns: {'observ':np.ones((64,64,3),dtype=np.uint8)}, reward, done, info
added to the tasks:

def own(config, params):
  # Works with `isolate_envs: thread`.
  action_repeat = params.get('action_repeat', 1)
  env_ctor = tools.bind(
      own_env, 'own, config, params, action_repeat,
      select_obs=None, obs_is_image=True, render_mode='state_pixels')
  return Task('adom', env_ctor, [])
def own_env(
    name, config, params, action_repeat, select_obs=None, obs_is_image=True,
    render_mode='rgb_array'):
  from dreamer import env as env_
  env = env_.Env()
  env = control.wrappers.ActionRepeat(env, action_repeat)
  if obs_is_image:
    env = control.wrappers.ObservationDict(env, 'observ')
  else:
    env = control.wrappers.ObservationDict(env, 'state')
  if select_obs is not None:
    env = control.wrappers.SelectObservations(env, select_obs)
  return _common_env(env, config, params)

def _common_env(env, config, params):
  env = control.wrappers.MinimumDuration(env, config.batch_shape[0])
  max_length = params.get('max_length', None)
  if max_length:
    env = control.wrappers.MaximumDuration(env, max_length)
  #env = control.wrappers.ConvertTo32Bit(env)
  return env

run like this:
python3 -m dreamer.scripts.train --logdir ./logdir/debug --params '{defaults: [dreamer, debug], tasks: [adom]}' \ --num_runs 1000 --resume_runs False
at this line I get obs as dict. what am I doing wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant