fsdl-text-recognizer-2021-labs icon indicating copy to clipboard operation
fsdl-text-recognizer-2021-labs copied to clipboard

Lab3 ctc loss causes Error

Open mprostock opened this issue 3 years ago • 4 comments

When running Lab 3 commands from the readme that use ctc loss, this error it thrown

    preds = torch.nn.functional.softmax(preds, dim=-1)
  File "/home/xxx/anaconda3/envs/fsdl/lib/python3.6/site-packages/torch/nn/functional.py", line 1512, in softmax
    ret = input.softmax(dim)
RuntimeError: "host_softmax" not implemented for 'Int'

This is due to the previous fix of the accuracy problem. The decoded content cannot be passed to the Accuracy-Metric Hack, the original Accuracy from pl.metrics should be used instead.

mprostock avatar Apr 28 '21 15:04 mprostock

Same error.

mazarbaloch avatar May 01 '21 13:05 mazarbaloch

I put .float() after preds and it worked just fine. image

oOXpycTOo avatar May 02 '21 17:05 oOXpycTOo

I put .float() after preds and it worked just fine. image

Still not working. Invoking error:

ValueError: If `preds` and `target` are of shape (N, ...) and `preds` are floats, `target` should be binary.

sanggusti avatar Jul 06 '21 12:07 sanggusti

Solving this issue by commenting out the run around predictions method #34

sanggusti avatar Jul 11 '21 04:07 sanggusti