the-full-stack / fsdl-text-recognizer-2021-labs

Complete deep learning project developed in Full Stack Deep Learning, Spring 2021
https://bit.ly/berkeleyfsdl
MIT License
452 stars 281 forks source link

Lab3 ctc loss causes Error #28

Open mprostock opened 3 years ago

mprostock commented 3 years ago

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.

mazarbaloch commented 3 years ago

Same error.

oOXpycTOo commented 3 years ago

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

sanggusti commented 3 years ago

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 commented 3 years ago

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