Error when generating M_seed in DropBlock_Ske
Closed this issue · 7 comments
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?
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 )
.
The error still happened :((
Does this error always happen during inference or occur occasionally?
It occurs occur occasionally.
From here, i figure that this issue may be attributed to that the input values may contain nan
.
I see. Thank you very much. I also observe that the output is non-deterministic. How can I make it deterministic?
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.