error trying to use yolov5+sahi on colab and gpu device #722
-
I'm trying to use gpu on Colab (I have Colab Pro+). I'm setting the parameter 'device'
but I get this error: ('model_path is not a valid yolov5 model path: ', AssertionError("Invalid CUDA '--device 0' requested, use '--device cpu' or pass valid CUDA device(s)")) |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 11 replies
-
Hello @lorenzlorg what are your Your error means, yolov5 cannot use your Colab GPU. Are you sure you have selected a GPU instance? What is your yolov5 path? is it a name (to be downloaded from git release) or a local weight path? |
Beta Was this translation helpful? Give feedback.
-
I have just tried this notebook on Google Colab GPU instance: https://github.com/obss/sahi/blob/main/demo/inference_for_yolov5.ipynb Updated first command with: and device with Did not have any issues. |
Beta Was this translation helpful? Give feedback.
-
Cause may be weight downloading is't finished, while code runs to laoding model. I got model size of around 16M at the first time when facing the same issue; After seting breakpoint after download part and wait for download fiinsh, I got the model of 25M. Then no more eroor. |
Beta Was this translation helpful? Give feedback.
-
@lorenzlorg how can i use the sahi for tensorflow models? |
Beta Was this translation helpful? Give feedback.
I have just tried this notebook on Google Colab GPU instance: https://github.com/obss/sahi/blob/main/demo/inference_for_yolov5.ipynb
Updated first command with:
!pip install -U torch==1.11.0 torchvision==0.12.0 pillow==8.* sahi yolov5
and device with
'cuda:0'
Did not have any issues.