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

UnboundLocalError in NeurIPS2019-Learn-to-Move-Challenge #191

Closed
luoruiming opened this issue Dec 21, 2019 · 2 comments
Closed

UnboundLocalError in NeurIPS2019-Learn-to-Move-Challenge #191

luoruiming opened this issue Dec 21, 2019 · 2 comments

Comments

@luoruiming
Copy link

When running sh scripts/train_difficulty1.sh ./low_speed_model , PARL remote error occurred. It
looks like the local variable 'reward_footstep_0' referenced before assignment.

[12-21 10:39:48 Thread-1 @train.py:287] saving models
[12-21 10:39:48 Thread-1 @train.py:290] saving rpm
Exception in thread Thread-4:
Traceback (most recent call last):
File "/home/luo/anaconda3/envs/opensim-rl/lib/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/home/luo/anaconda3/envs/opensim-rl/lib/python3.6/threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "train.py", line 190, in run_remote_sample
obs, reward, done, info = remote_actor.step(action)
File "/home/luo/anaconda3/envs/opensim-rl/lib/python3.6/site-packages/parl/remote/remote_decorator.py", line 189, in wrapper
raise RemoteError(attr, error_str)
parl.remote.exceptions.RemoteError: [PARL remote error when calling function step]:
local variable 'reward_footstep_0' referenced before assignment
traceback:
Traceback (most recent call last):
File "/home/luo/anaconda3/envs/opensim-rl/lib/python3.6/site-packages/parl/remote/job.py", line 379, in single_task
ret = getattr(obj, function_name)(*args, **kwargs)
File "/home/luo/PARL/examples/NeurIPS2019-Learn-to-Move-Challenge/actor.py", line 56, in step
return self.env.step(action, project=False)
File "/tmp/tmpm9llqji1/env_wrapper.py", line 219, in step
obs, r, done, info = self.env.step(action, **kwargs)
File "/tmp/tmpm9llqji1/env_wrapper.py", line 51, in step
return self.env.step(action, **kwargs)
File "/tmp/tmpm9llqji1/env_wrapper.py", line 68, in step
obs, reward, done, info = self.env.step(action, **kwargs)
File "/tmp/tmpm9llqji1/env_wrapper.py", line 119, in step
obs, r, done, info = self.env.step(action, **kwargs)
File "/home/luo/anaconda3/envs/opensim-rl/lib/python3.6/site-packages/osim/env/osim.py", line 562, in step
_, reward, done, info = super(L2M2019Env, self).step(action_mapped, project=project, obs_as_dict=obs_as_dict)
File "/home/luo/anaconda3/envs/opensim-rl/lib/python3.6/site-packages/osim/env/osim.py", line 356, in step
return [ obs, self.get_reward(), self.is_done() or (self.osim_model.istep >= self.spec.timestep_limit), {} ]
File "/home/luo/anaconda3/envs/opensim-rl/lib/python3.6/site-packages/osim/env/osim.py", line 764, in get_reward
return self.get_reward_1()
File "/home/luo/anaconda3/envs/opensim-rl/lib/python3.6/site-packages/osim/env/osim.py", line 821, in get_reward_1
reward += reward_footstep_0 + 10
UnboundLocalError: local variable 'reward_footstep_0' referenced before assignment

I worked on Ubuntu 16.04 with Titan XP GPU.

@zenghsh3
Copy link
Contributor

It's a bug in the osim-rl package. stanfordnmbl/osim-rl#215

You can uncomment the following line to fix the bug for now.
https://github.com/stanfordnmbl/osim-rl/blob/9be49551ab617768d30488c961b0ac78cf209c88/osim/env/osim.py#L819

@luoruiming
Copy link
Author

luoruiming commented Dec 21, 2019

Nailed it! Thanks!

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

2 participants