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

Usage of bctrainer.py #6

Open
AlexWanghaoming opened this issue Jul 24, 2022 · 0 comments
Open

Usage of bctrainer.py #6

AlexWanghaoming opened this issue Jul 24, 2022 · 0 comments

Comments

@AlexWanghaoming
Copy link

Hi, Could you please offer an example of bctrainer.py. I input the trajs file collected from web user interface but meet an error:

Traceback (most recent call last):
File "/Users/alexwang/phD/PantheonRL/bctrainer.py", line 106, in
clone.train(n_epochs=args.total_epochs)
File "/Users/alexwang/phD/PantheonRL/pantheonrl/algos/bc.py", line 352, in train
batch["obs"], batch["acts"])
File "/Users/alexwang/phD/PantheonRL/pantheonrl/algos/bc.py", line 291, in _calculate_loss
_, log_prob, entropy = self.policy.evaluate_actions(obs, acts)
File "/Users/alexwang/miniconda/envs/PantheonRL/lib/python3.7/site-packages/stable_baselines3/common/policies.py", line 640, in evaluate_actions
log_prob = distribution.log_prob(actions)
File "/Users/alexwang/miniconda/envs/PantheonRL/lib/python3.7/site-packages/stable_baselines3/common/distributions.py", line 278, in log_prob
return self.distribution.log_prob(actions)
File "/Users/alexwang/miniconda/envs/PantheonRL/lib/python3.7/site-packages/torch/distributions/categorical.py", line 117, in log_prob
self._validate_sample(value)
File "/Users/alexwang/miniconda/envs/PantheonRL/lib/python3.7/site-packages/torch/distributions/distribution.py", line 277, in _validate_sample
raise ValueError('The value argument must be within the support')
ValueError: The value argument must be within the support

My torch version is 1.8.1, stable-baselines3 version is 1.2.0a0

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

1 participant