Can't make it run on Colab

#33
by sanggusti - opened

Trying to make a colab notebook to try PaddleOCR-VL, but getting version mismatched either CUDA versions or distribution mismatch.

Colab currently has cuda version 12.5, but PaddleOCR-VL didn't have release for cuda version 12.5

image

Can we have some notebook demo?

Hi, may I know u are using a better GPU hardware than T4 GPU in Colab?
Because when I tried run in Colab with T4 GPU. The error I got when running the python script

ResourceExhaustedError: 

Out of memory error on GPU 0. Cannot allocate 11.809693GB memory on GPU 0, 4.745056GB memory has been allocated and available memory is only 9.996216GB.

During installation, I did get error:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
torch 2.8.0+cu126 requires nvidia-cudnn-cu12==9.10.2.21; platform_system == "Linux" and platform_machine == "x86_64", but you have nvidia-cudnn-cu12 9.5.1.17 which is incompatible.
torch 2.8.0+cu126 requires nvidia-cusparselt-cu12==0.7.1; platform_system == "Linux" and platform_machine == "x86_64", but you have nvidia-cusparselt-cu12 0.6.3 which is incompatible.
torch 2.8.0+cu126 requires nvidia-nccl-cu12==2.27.3; platform_system == "Linux" and platform_machine == "x86_64", but you have nvidia-nccl-cu12 2.25.1 which is incompatible.

The below is the script I used:

!pip install -U "paddleocr[doc-parser]"
!pip install paddlepaddle-gpu==3.2.0 -i https://www.paddlepaddle.org.cn/packages/stable/cu126/
!pip install https://paddle-whl.bj.bcebos.com/nightly/cu126/safetensors/safetensors-0.6.2.dev0-cp38-abi3-linux_x86_64.whl
import time
from paddleocr import PaddleOCRVL

pipeline = PaddleOCRVL()

start_time = time.time()

output = pipeline.predict(r"/content/input.png")
for res in output:
    res.print()
    res.save_to_json(save_path="output")
    res.save_to_markdown(save_path="output")

end_time = time.time()
print(f"Time taken: {end_time - start_time} seconds")

Sign up or log in to comment