"Warning: NaN or Inf found in input tensor" but Input tensors do not contain NaN or Inf

I am getting the following warning.

I have checked that all the tensors that are either input to the model or being created inside the model are never NaN or Inf unlike this Warning: NaN or Inf found in input tensor.

Could you please help me to resolve this issue. Thank you very much,


How did you make sure that no input value is a NaN or Inf?
Could you share some code and maybe add an assert statement to raise an exception, if a NaN or Inf was detected?

I got the fix here https://github.com/lanpa/tensorboardX/pull/469

Hi, I am also getting the same error and have feeling might have something to do with tensorboard. Could you please share what did you changed. Your provided link is not quite clear

@szahan did you solve this issue? I have the exact same problem.

Hi, in my case it had nothing to do with tensorboard, instead, I was logging some values that had Nans in them, hence the error.