Skip to content

Warnings and errors during prediction #18

@dlazesz

Description

@dlazesz

FYI: If I try to run emBERT (ab4bbda and 2393b4a@emtsv) on MNSZ2 the following warnings and errors are generated:

/usr/local/lib/python3.8/site-packages/torch/cuda/__init__.py:52: UserWarning: CUDA initialization: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx (Triggered internally at  /pytorch/c10/cuda/CUDAFunctions.cpp:100.)
  return torch._C._cuda_getDeviceCount() > 0
done
/app/embert/embert/viterbi.py:29: RuntimeWarning: divide by zero encountered in log
  self.init = fn(init, dtype=float)
/app/embert/embert/viterbi.py:31: RuntimeWarning: divide by zero encountered in log
  self.trans = fn(trans, dtype=float).T

Do I have to have CUDA for prediction?
These divide by zero warnings do not look good. They should be silenced if they are not meaningful.

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/xtsv/tsvhandler.py", line 67, in process
    yield from ('{0}\n'.format('\t'.join(tok)) for tok in internal_app.process_sentence(sen, field_values))
  File "/app/embert/embert/embert.py", line 99, in process_sentence
    classes = self.evaluator.predict().y_pred[0]
  File "/app/embert/embert/evaluate.py", line 73, in predict
    return self(True)
  File "/app/embert/embert/evaluate.py", line 97, in __call__
    seq_len = np.where(max_prob == self.sep_id)[0][0]
IndexError: index 0 is out of bounds for axis 0 with size 0

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/app/main.py", line 25, in <module>
    output_iterator.writelines(build_pipeline(input_data, used_tools, tools, presets, conll_comments))
  File "/usr/local/lib/python3.8/site-packages/xtsv/tsvhandler.py", line 70, in process
    raise type(e)('In "{0}" at {1}: {2}'.format(track_stream['file_name'], curr_line, str(e))).\
  File "/usr/local/lib/python3.8/site-packages/xtsv/tsvhandler.py", line 67, in process
    yield from ('{0}\n'.format('\t'.join(tok)) for tok in internal_app.process_sentence(sen, field_values))
  File "/app/embert/embert/embert.py", line 99, in process_sentence
    classes = self.evaluator.predict().y_pred[0]
  File "/app/embert/embert/evaluate.py", line 73, in predict
    return self(True)
  File "/app/embert/embert/evaluate.py", line 97, in __call__
    seq_len = np.where(max_prob == self.sep_id)[0][0]
IndexError: In "no filename for stream" at [LINE XXX]: index 0 is out of bounds for axis 0 with size 0

This stops the processing of the current file.

I don't want to urge you, just reporting the above bugs/behaviour.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions