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:

  
    
    
    Nan Loss coming after some time 
  
  
    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
  



  
    
    
    Getting Nan after first iteration with custom loss 
  
  
    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()
  



  
      stackoverflow.com
  
  
      
    
  

  Pytorch loss inf nan 1



  regression, pytorch



  asked by
  
  
    JAbrams
  
  on 11:37PM - 25 Jun 18 UTC