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

replicate cog Model setup failed #671

Open
xrunda opened this issue Oct 8, 2023 · 1 comment
Open

replicate cog Model setup failed #671

xrunda opened this issue Oct 8, 2023 · 1 comment

Comments

@xrunda
Copy link

xrunda commented Oct 8, 2023

$ sudo cog predict -i source_image=https://project-resource.oss-cn-beijing.aliyuncs.com/baby.png -i driven_audio=https://project-resource.oss-cn-beijing.aliyuncs.com/baby.wav
Building Docker image from environment in cog.yaml...

Starting Docker image cog-sadtalker-base and running setup()...
docker: Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error running hook #0: error running hook: exit status 1, stdout: , stderr: Auto-detected mode as 'legacy'
nvidia-container-cli: initialization error: load library failed: libnvidia-ml.so.1: cannot open shared object file: no such file or directory: unknown.
Missing device driver, re-trying without GPU
Error response from daemon: page not found
using safetensor as default
Traceback (most recent call last):
File "/root/.pyenv/versions/3.8.18/lib/python3.8/site-packages/cog/server/worker.py", line 185, in _setup
run_setup(self._predictor)
File "/root/.pyenv/versions/3.8.18/lib/python3.8/site-packages/cog/predictor.py", line 66, in run_setup
predictor.setup()
File "predict.py", line 25, in setup
self.preprocess_model = CropAndExtract(sadtalker_paths, device
File "/src/src/utils/preprocess.py", line 49, in init
self.propress = Preprocesser(device)
File "/src/src/utils/croper.py", line 21, in init
self.predictor = KeypointExtractor(device)
File "/src/src/face3d/extract_kp_videos_safe.py", line 45, in init
self.detector = init_alignment_model('awing_fan',device=device, model_rootpath=root_path)
File "/src/src/face3d/extract_kp_videos_safe.py", line 28, in init_alignment_model
model.load_state_dict(torch.load(model_path, map_location=device)['state_dict'], strict=True)
File "/root/.pyenv/versions/3.8.18/lib/python3.8/site-packages/torch/serialization.py", line 713, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File "/root/.pyenv/versions/3.8.18/lib/python3.8/site-packages/torch/serialization.py", line 930, in _legacy_load
result = unpickler.load()
File "/root/.pyenv/versions/3.8.18/lib/python3.8/site-packages/torch/serialization.py", line 876, in persistent_load
wrap_storage=restore_location(obj, location),
File "/root/.pyenv/versions/3.8.18/lib/python3.8/site-packages/torch/serialization.py", line 970, in restore_location
return default_restore_location(storage, map_location)
File "/root/.pyenv/versions/3.8.18/lib/python3.8/site-packages/torch/serialization.py", line 175, in default_restore_location
result = fn(storage, location)
File "/root/.pyenv/versions/3.8.18/lib/python3.8/site-packages/torch/serialization.py", line 152, in _cuda_deserialize
device = validate_cuda_device(location)
File "/root/.pyenv/versions/3.8.18/lib/python3.8/site-packages/torch/serialization.py", line 136, in validate_cuda_device
raise RuntimeError('Attempting to deserialize object on a CUDA '
RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location=torch.device('cpu') to map your storages to the CPU.
ⅹ Model setup failed

=================================
cog.yaml

build:
gpu: true
cuda: "11.3"
python_version: "3.8"
system_packages:
- "ffmpeg"
- "libgl1-mesa-glx"
- "libglib2.0-0"
python_packages:
- "torch==1.12.1"
- "torchvision==0.13.1"
- "torchaudio==0.12.1"
- "joblib==1.1.0"
- "scikit-image==0.19.3"
- "basicsr==1.4.2"
- "facexlib==0.3.0"
- "resampy==0.3.1"
- "pydub==0.25.1"
- "scipy==1.10.1"
- "kornia==0.6.8"
- "face_alignment==1.3.5"
- "imageio==2.19.3"
- "imageio-ffmpeg==0.4.7"
- "librosa==0.9.2" #
- "tqdm==4.65.0"
- "yacs==0.1.8"
- "gfpgan==1.3.8"
- "dlib-bin==19.24.1"
- "av==10.0.0"
- "trimesh==3.9.20"
- "safetensors"
run:
- mkdir -p /root/.cache/torch/hub/checkpoints/ && wget --output-document "/root/.cache/torch/hub/checkpoints/s3fd-619a316812.pth" "https://www.adrianbulat.com/downloads/python-fan/s3fd-619a316812.pth"
- mkdir -p /root/.cache/torch/hub/checkpoints/ && wget --output-document "/root/.cache/torch/hub/checkpoints/2DFAN4-cd938726ad.zip" "https://www.adrianbulat.com/downloads/python-fan/2DFAN4-cd938726ad.zip"

predict: "predict.py:Predictor"

==============================
$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Mon_Apr__3_17:16:06_PDT_2023
Cuda compilation tools, release 12.1, V12.1.105
Build cuda_12.1.r12.1/compiler.32688072_0

How do I fix this bug?

@idootop
Copy link

idootop commented May 10, 2024

You may need to install NVIDIA Container Toolkit first.

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

2 participants