segment-any-text / wtpsplit

Toolkit to segment text into sentences or other semantic units in a robust, efficient and adaptable way.
MIT License
624 stars 36 forks source link

`AttributeError: 'InferenceSession' object has no attribute '_providers' Segmentation fault (core dumped)` #74

Closed Errorbot1122 closed 1 year ago

Errorbot1122 commented 1 year ago

I was trying to segment sentences for my transcribing program, but I ran into this error when I first tried using it this.

Full Error

Traceback (most recent call last):
  File "/home/runner/Voice-Synthasizer/venv/lib/python3.8/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 280, in __init__
    self._create_inference_session(providers, provider_options)
  File "/home/runner/Voice-Synthasizer/venv/lib/python3.8/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 307, in _create_inference_session
    sess = C.InferenceSession(session_options, self._model_path, True, self._read_config_from_model)
RuntimeError: /onnxruntime_src/onnxruntime/core/platform/posix/env.cc:142 onnxruntime::{anonymous}::PosixThread::PosixThread(const char*, int, unsigned int (*)(int, Eigen::ThreadPoolInterface*), Eigen::ThreadPoolInterface*, const onnxruntime::ThreadOptions&) pthread_setaffinity_np failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "speech.py", line 436, in <module>
    transcript, source_align_data = transcript_audio(input_path, True, transcript_path, granularity=granularity)
  File "speech.py", line 271, in transcript_audio
    sentence_segmenter = NNSplit.load("en")
  File "backend.py", line 6, in create_session
  File "/home/runner/Voice-Synthasizer/venv/lib/python3.8/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 283, in __init__
    print("EP Error using {}".format(self._providers))
AttributeError: 'InferenceSession' object has no attribute '_providers'
Segmentation fault (core dumped)
bminixhofer commented 1 year ago

Hi! Sorry for being so quiet on this library. I have been working on a major revamp, expanding support to 85 languages, switching to a new training objective without labelled data, and switching the backbone to a BERT-style model.

It now uses PyTorch by default, so this should not be a problem anymore!