hulianyuyy / DSTA-SLR

Dynamic Spatial-Temporal Aggregation for Skeleton-Aware Sign Language Recognition (COLING2024)
Other
6 stars 2 forks source link

Error when generating M_seed in DropBlock_Ske #2

Open tanthinhdt opened 4 months ago

tanthinhdt commented 4 months ago

Sometimes I encounter this error while making inference

  File "/mnt/d/spaces/DSTA-SLR/models/dropSke.py", line 28, in forward
    M_seed = torch.bernoulli(torch.clamp(input_abs * gamma, max=1.0)).to(
RuntimeError: Expected p_in >= 0 && p_in <= 1 to be true, but got false.  (Could this error message be improved?  If so, please report an enhancement request to PyTorch.)

How can I prevent this error for good? Is M_seed the reason that the output is non-deterministic?

hulianyuyy commented 4 months ago

I haven't encounter this error, but i figure that you may change the code into M_seed = torch.bernoulli(torch.clamp(input_abs * gamma, min=0.0, max=1.0)).to( device=input.device, dtype=input.dtype ).

tanthinhdt commented 4 months ago

The error still happened :((

hulianyuyy commented 4 months ago

Does this error always happen during inference or occur occasionally?

tanthinhdt commented 4 months ago

It occurs occur occasionally.

hulianyuyy commented 4 months ago

From here, i figure that this issue may be attributed to that the input values may contain nan.

tanthinhdt commented 4 months ago

I see. Thank you very much. I also observe that the output is non-deterministic. How can I make it deterministic?

hulianyuyy commented 3 months ago

It seems strange because i have made the code deterministic in the init_seed part in the main.py. I also get deterministic results during training in my process.