[BUG] target_value_network_params
initialization bug in convert_to_functional()
#2523
Open
3 tasks done
Labels
bug
Something isn't working
Bug Description
During the initialization of
LossModule
and execution ofconvert_to_functional()
, the first layer parameters are set asUninitializedParameter(shape=torch.Size(-1))
. Consequently, whentarget_value_network_params
is cloned from this, it becomesParameter(torch.Size(0))
, leading to the error:RuntimeError: mat2 must be a matrix, got 1-D tensor
.In the
DiscreteCQLLoss
class, when callingvalue_estimate
, theparams
argument should referencetarget_params
instead, as indicated in this line of code.To Reproduce
Steps to reproduce the behavior.
System info
python=3.10.15
torchrl=0.5.0
torch=2.4.1
Possible fixes
Specify input features in
MLP
module.module = MLP(in_features=4, out_features=(nbins, action_dim), depth=2)
This prevents the module parameters from being
UninitializedParameter
Checklist
Thanks to @BY571 and @vmoens
The text was updated successfully, but these errors were encountered: