Why rllib run my custom model with dummy inputs?

I defined a custom model and a custom environment (I’m using Pytorch).

It seems my model is first called with some dummy input (I put print statements in both my environment and model, but the print of the model appears first).

The problem is that these dummy inputs crashes my model (mask with all values to 0).

Is there a way to disable this behavior ?

I assume we’re doing some kind of tracing/validation here. cc @sven1977 can you confirm and can we disable this?

1 Like

Hey @Astariul , yeah, this is the initial test pass when initializing the loss. Contains all 0s.
We are not intending to change this, though, but could you try to catch this in your model for now with some if block?

1 Like

Thank you @kai and @sven1977 for your quick answers !

Yeah I ended up doing exactly this : when my mask contains all zeros, I ended up with NaN, so I just changed the NaN to 0.

1 Like