danielgatis / rembg

Rembg is a tool to remove images background
MIT License
15.46k stars 1.76k forks source link

[BUG] ...COLAB GPU not detected in ONNX model #582

Closed sinbrolly closed 3 months ago

sinbrolly commented 5 months ago

Couldn't run onnx-gpu u2net on COLAB gpu.

!pip install rembg[gpu] -qU
!pip install onnxruntime-gpu==1.12.0 -qU

import torch
torch.cuda.is_available()
True

import onnxruntime as ort
ort.get_available_providers()
[
'TensorrtExecutionProvider',
 'CUDAExecutionProvider', 
'CPUExecutionProvider'
]

from rembg import remove, new_session
session = new_session('u2net')
Downloading data from 'https://github.com/danielgatis/rembg/releases/download/v0.0.0/u2net.onnx' to file '/root/.u2net/u2net.onnx'.
100%|████████████████████████████████████████| 176M/176M [00:00<00:00, 102GB/s]

session.inner_session.get_providers()
['CPUExecutionProvider']
github-actions[bot] commented 4 months ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 3 months ago

This issue was closed because it has been inactive for 14 days since being marked as stale.