pytorch / pytorch/rl

[BUG] TransformedEnv.transform[0].init_stats cause exception

Open
#1,087 4 comments 0 reactions 1 assignee View on GitHub

@vmoens is already working on this.

Since Apr 25, 2023.

bug
Dominant language
Python
Stars
3.6k
Forks
487
Avg merge
1d 1h
Merged PRs (30d)
207

Description

I'm using torch2.0, follow the reinforcement_ppo.py, on line:

env.transform[0].init_stats(num_iter=1, reduce_dim=0, cat_dim=0)

I got exception:

env.transform[0].init_stats(num_iter=1, reduce_dim=0, cat_dim=0)
File "D:\Working\pycharm_workspace\RL\torchrl\torchrl\envs\transforms\transforms.py", line 1747, in init_stats
loc = data.mean(reduce_dim, keepdim=True)
RuntimeError: mean(): could not infer output dtype. Input dtype must be either a floating point or complex dtype. Got: Short

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.