RuntimeError: batch dimension mismatch
@vmoens is already working on this.
Since Jun 26, 2023.
- Dominant language
- Python
- Stars
- 3.6k
- Forks
- 487
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 207
Description
python version is 3.9.16
torchrl version is 0.1.0+a32d2e7
torch version is 2.0.1
when creating a gym Instance:
from torchrl.envs.libs.gym import GymEnv
import torch
device = "cpu" if not torch.has_cuda else "cuda:0"
frame_skip = 1
base_env = GymEnv("InvertedDoublePendulum-v4", device=device, frame_skip=frame_skip)
throw the following exception:
RuntimeError: batch dimension mismatch, got self.batch_size=[] and value.shape[:self.batch_dims]=torch.Size([]) with value tensor([ 0.0663, 0.0682, -0.0238, 0.9977, 0.9997, 0.1421, 0.1762, -0.0032,
0.0000, 0.0000, 0.0000], dtype=torch.float64)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.