alphacep / alphacep/vosk-api

Segmentation Fault Using Vosk with YOLOv7 on CUDA

Open
#1,943 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
15.1k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

When working on a project using the Vosk and YOLOv7 vision model, I encountered a segmentation fault when attempting to load the YOLOv7 on a CUDA device.

I found that the segmentation fault only occurs when the `vosk` module is imported before the YOLOv7 model is loaded on CUDA. Loading YOLO on CPU prevents the error. Commenting out the Vosk import or putting it after model instantiation also avoids the issue.

---
### To reproduce:

1. Clone the YOLOv7 repository:
```bash
git clone https://github.com/WongKinYiu/yolov7.git
2. Download `yolov7.pt` using the link in the repo
3. Run the following python script:

```python
from vosk import Model, KaldiRecognizer
import sys
sys.path.append('./yolov7')
from models.experimental import attempt_load
model = attempt_load("path/to/yolov7.pt", "cuda")
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.