GPU using ZeroGPU

#29
by jassinghNY - opened

I'm getting the error below. I think the requirements need to be updated. I adjusted the parameters to cuda in the app.py.

===== Application Startup at 2024-09-22 05:04:42 =====

The cache for model files in Transformers v4.22.0 has been updated. Migrating your old cache. This is a one-time only operation. You can interrupt this and resume the migration later on by calling transformers.utils.move_cache().

0it [00:00, ?it/s]
0it [00:00, ?it/s]
/usr/local/lib/python3.10/site-packages/lama_cleaner/model/ldm.py:272: FutureWarning: torch.cuda.amp.autocast(args...) is deprecated. Please use torch.amp.autocast('cuda', args...) instead.
@torch .cuda.amp.autocast()
[W922 07:05:13.783762579 init.cpp:767] Warning: nvfuser is no longer supported in torch script, use _jit_set_nvfuser_enabled is deprecated and a no-op (function operator())
2024-09-22 07:05:13.668 | INFO | lama_cleaner.server:build_plugins:481 - Initialize InteractiveSeg plugin
Downloading: "https://dl.fbaipublicfiles.com/segment_anything/sam_vit_b_01ec64.pth" to /home/user/.cache/torch/hub/checkpoints/sam_vit_b_01ec64.pth

0%| | 0.00/358M [00:00<?, ?B/s]
86%|████████▋ | 309M/358M [00:01<00:00, 324MB/s]
100%|██████████| 358M/358M [00:01<00:00, 328MB/s]
2024-09-22 07:05:15.532 | INFO | lama_cleaner.helper:download_model:52 - Download model success, md5: 01ec64d29a2fca3f0661936605ae66f8
2024-09-22 07:05:15.532 | INFO | lama_cleaner.plugins.interactive_seg:__init__:37 - SegmentAnything model path: /home/user/.cache/torch/hub/checkpoints/sam_vit_b_01ec64.pth
/usr/local/lib/python3.10/site-packages/lama_cleaner/plugins/segment_anything/build_sam.py:105: FutureWarning: You are using torch.load with weights_only=False (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for weights_only will be flipped to True. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via torch.serialization.add_safe_globals. We recommend you start setting weights_only=True for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
state_dict = torch.load(f)
Traceback (most recent call last):
File "/home/user/app/app.py", line 44, in
main(FakeArgs())
File "/usr/local/lib/python3.10/site-packages/lama_cleaner/server.py", line 542, in main
build_plugins(args)
File "/usr/local/lib/python3.10/site-packages/lama_cleaner/server.py", line 482, in build_plugins
plugins[InteractiveSeg.name] = InteractiveSeg(
File "/usr/local/lib/python3.10/site-packages/lama_cleaner/plugins/interactive_seg.py", line 39, in init
sam_model_registrymodel_name.to(device)
File "/usr/local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1174, in to
return self._apply(convert)
File "/usr/local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 780, in _apply
module._apply(fn)
File "/usr/local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 780, in _apply
module._apply(fn)
File "/usr/local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 780, in _apply
module._apply(fn)
File "/usr/local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 805, in _apply
param_applied = fn(param)
File "/usr/local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1160, in convert
return t.to(
File "/usr/local/lib/python3.10/site-packages/torch/cuda/init.py", line 314, in _lazy_init
torch._C._cuda_init()
RuntimeError: No CUDA GPUs are available
The cache for model files in Transformers v4.22.0 has been updated. Migrating your old cache. This is a one-time only operation. You can interrupt this and resume the migration later on by calling transformers.utils.move_cache().

0it [00:00, ?it/s]
0it [00:00, ?it/s]
/usr/local/lib/python3.10/site-packages/lama_cleaner/model/ldm.py:272: FutureWarning: torch.cuda.amp.autocast(args...) is deprecated. Please use torch.amp.autocast('cuda', args...) instead.
@torch .cuda.amp.autocast()
[W922 07:05:24.423779267 init.cpp:767] Warning: nvfuser is no longer supported in torch script, use _jit_set_nvfuser_enabled is deprecated and a no-op (function operator())
2024-09-22 07:05:24.297 | INFO | lama_cleaner.server:build_plugins:481 - Initialize InteractiveSeg plugin
Downloading: "https://dl.fbaipublicfiles.com/segment_anything/sam_vit_b_01ec64.pth" to /home/user/.cache/torch/hub/checkpoints/sam_vit_b_01ec64.pth

0%| | 0.00/358M [00:00<?, ?B/s]
81%|████████ | 288M/358M [00:01<00:00, 302MB/s]
100%|██████████| 358M/358M [00:01<00:00, 319MB/s]
2024-09-22 07:05:26.171 | INFO | lama_cleaner.helper:download_model:52 - Download model success, md5: 01ec64d29a2fca3f0661936605ae66f8
2024-09-22 07:05:26.171 | INFO | lama_cleaner.plugins.interactive_seg:__init__:37 - SegmentAnything model path: /home/user/.cache/torch/hub/checkpoints/sam_vit_b_01ec64.pth
/usr/local/lib/python3.10/site-packages/lama_cleaner/plugins/segment_anything/build_sam.py:105: FutureWarning: You are using torch.load with weights_only=False (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for weights_only will be flipped to True. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via torch.serialization.add_safe_globals. We recommend you start setting weights_only=True for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
state_dict = torch.load(f)
Traceback (most recent call last):
File "/home/user/app/app.py", line 44, in
main(FakeArgs())
File "/usr/local/lib/python3.10/site-packages/lama_cleaner/server.py", line 542, in main
build_plugins(args)
File "/usr/local/lib/python3.10/site-packages/lama_cleaner/server.py", line 482, in build_plugins
plugins[InteractiveSeg.name] = InteractiveSeg(
File "/usr/local/lib/python3.10/site-packages/lama_cleaner/plugins/interactive_seg.py", line 39, in init
sam_model_registrymodel_name.to(device)
File "/usr/local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1174, in to
return self._apply(convert)
File "/usr/local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 780, in _apply
module._apply(fn)
File "/usr/local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 780, in _apply
module._apply(fn)
File "/usr/local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 780, in _apply
module._apply(fn)
File "/usr/local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 805, in _apply
param_applied = fn(param)
File "/usr/local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1160, in convert
return t.to(
File "/usr/local/lib/python3.10/site-packages/torch/cuda/init.py", line 314, in _lazy_init
torch._C._cuda_init()
RuntimeError: No CUDA GPUs are available

Sign up or log in to comment