nairbv
(Brian Vaughan)
January 15, 2020, 8:42pm
2
If you just add one of the data parameters (descdata or gender) do you still see the issue? what loss function are you using? You might also want to check some of the other threads on nan loss to get some ideas:
The loss function is a combination of Mean Sqaured error loss and cross-entropy loss.
When i am training my model, there is a finite loss but after some time, the loss is NaN and continues to be so.
When I am training my model just on a single batch of 10 images, the loss is finite most of the times, but sometimes that is also NaN.
Please suggest a possible solution.
Thanks in advance
Thank you for your replay
You are right, I did that on purpose because I am trying to mimic a paper that explained the network in this way. However, I tried to add non-linearty between them ,but unfortunately didn’t fix the NaN error.
debugging the code, I notice the NaN appears in the weights of the model after I call the optimizer()
regression, pytorch