Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error While Using Machine With Only CPU (EC2 Instance) #800

Open
anappdev opened this issue May 9, 2024 · 3 comments
Open

Error While Using Machine With Only CPU (EC2 Instance) #800

anappdev opened this issue May 9, 2024 · 3 comments

Comments

@anappdev
Copy link

anappdev commented May 9, 2024

Trying to install on EC2 Amazon Linux, Number of vCPUs= 4, instance type = t2.xlarge

It gives error
Traceback (most recent call last):
File "/home/ec2-user/xwhisper.py", line 6, in
import whisperx
File "/mnt/efs/fs1/ml/whisperx/whisperx/init.py", line 1, in
from .transcribe import load_model
File "/mnt/efs/fs1/ml/whisperx/whisperx/transcribe.py", line 9, in
from .alignment import align, load_align_model
File "/mnt/efs/fs1/ml/whisperx/whisperx/alignment.py", line 11, in
import torchaudio
File "/home/ec2-user/.local/lib/python3.9/site-packages/torchaudio/init.py", line 1, in
from torchaudio import ( # noqa: F401
File "/home/ec2-user/.local/lib/python3.9/site-packages/torchaudio/_extension/init.py", line 43, in
_load_lib("libtorchaudio")
File "/home/ec2-user/.local/lib/python3.9/site-packages/torchaudio/_extension/utils.py", line 61, in _load_lib
torch.ops.load_library(path)
File "/home/ec2-user/.local/lib/python3.9/site-packages/torch/_ops.py", line 643, in load_library
ctypes.CDLL(path)
File "/usr/lib64/python3.9/ctypes/init.py", line 374, in init
self._handle = _dlopen(self._name, mode)
OSError: libtorch_cuda.so: cannot open shared object file: No such file or directory

Any support for CPU only environment?

@SeeknnDestroy
Copy link

SeeknnDestroy commented May 15, 2024

Hey @anappdev,

Can you please try to use int8 as compute type?

import whisperx

model = whisperx.load_model(compute_type="int8")

@anappdev
Copy link
Author

Hey @anappdev,

Can you please try to use int8 as compute type?

import whisperx

model = whisperx.load_model(compute_type="int8")

I used compute_type="int8", when I got that error

@kepstin
Copy link

kepstin commented May 28, 2024

This error looks like you have installed the "cpu only" version of torch (pytorch) but your torchaudio doesn't match, and is the gpu version. What method did you use to install torch and torchaudio? It seems to be pip from the file paths, but it would be good to confirm.

If you use pip, run

pip3 install torch torchaudio --index-url https://download.pytorch.org/whl/cpu

(add --force-reinstall if needed to replace the other version)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants