ChenRocks / ChenRocks/fast_abs_rl

raise RuntimeError("Mismatch in shape: grad_output[" RuntimeError: Mismatch in shape: grad_output[0] has a shape of torch.Size([1]) and output[0] has a shape of torch.Size([]).

Open
#73 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
624
Forks
183
PR merge metrics
No merged PRs in 30d

Description

deer
how to solve it?in the rl.py
autograd.backward(
[critic_loss] + losses,
[torch.ones(1).to(critic_loss.device)]*(1+len(losses)),
)
raise that problem

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in rl.py at the autograd.backward call shown in the report and reproduce the RuntimeError. Inspect the shapes of critic_loss, losses, and the supplied gradients; done means the reported shape mismatch no longer occurs.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.