-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
negative loss #50
Comments
The GPU version has done log_softmax inside. Did you apply log_softmax to activations? |
@HawkAaron |
Did you follow the same procedure as bellow? GPU: logits -> RNNTLoss |
@HawkAaron
when run on cpu, there is a log_softmax in your implemention before RNNTLoss, so I don't need to operate an activation to logits. when run on gpu, the log_softmax is inside the RNNTLoss, so I also don't need to operate an activation to logits. BTW, If I put the network on gpu for calculation and put the logits back to cpu to calculate the RNNTLoss, the loss is normal again. |
Could you update the code and rebuild again? Everything is ok in my environment. |
I have updated the latest code. But I haven't solved the problem. So I calculated the RNNTLoss on cpu at last. Maybe I will find the problem later when I debug my code. |
I have the same problem when using tensorflow 1.15.0.rc2 (CUDA 10, gcc 7.4.0) Previously I used tf 1.10 and everything was ok, then I upgraded tf, update and rebuild RNNTLoss, and get negative loss. I install RNNTLoss using the following steps in docker: ENV CUDA_HOME /usr/local/cuda |
UPD: Also, I got the following error using tf 1.10: UPD2: |
Just a quick question: Should the blank label be compulsorily 0? What about GPU vs CPU? |
I also have the question that is it reasonable to have negative loss, maybe it is because the probability i s the sum of all alignments, which means the probability can be larger than 1 and the loss can be negative? |
The recent pull request #64 may fix this issue. |
@Sudharsansai The blank label can be any class inside your vocab (with blank included). |
Hi :
I am using the GPU version RNNTLoss, but the loss is negative.
the shape of logits and targets is as follows:
targets: [batch_size, U]
logits: [batch_size, T, U+1, hidden]
RNNTloss(logits, targets, input_len, target_len)
However when I run on cpu, the loss is normal.
The text was updated successfully, but these errors were encountered: