YaoFANGUK / video-subtitle-remover

基于AI的图片/视频硬字幕去除、文本水印去除,无损分辨率生成去字幕、去水印后的图片/视频文件。无需申请第三方API,本地实现。AI-based tool for removing hard-coded subtitles and text-like watermarks from videos or Pictures.
Apache License 2.0
3.25k stars 431 forks source link

import torch 和 paddle 是会出现注册问题要怎么解决 #26

Open T0L0ve opened 6 months ago

T0L0ve commented 6 months ago

config.py中同时import torch和paddlepaddle会出现

ImportError: generic_type: type "_gpuDeviceProperties" is already registered!

cuda版本11.8 torch版本2.0.1 paddle-gpu 2.4.2和2.6都试过没有解决

YaoFANGUK commented 6 months ago

https://github.com/PaddlePaddle/PaddleOCR/issues/10558

T0L0ve commented 6 months ago

我使用py310重新编译paddle2.4.2仍然显示相同问题,是对python版本另有要求吗

jinwyp commented 6 months ago

请使用以下脚本 新建一个setup.bat 内容如下 在python3.10 环境下 运行既可

torch 使用最新的版本 2.1.2 CUDA 12.1 paddlepaddle 使用 2.4.2 gpu CUDA11.7

@echo off
IF NOT EXIST venv (
    python -m venv venv
) ELSE (
    echo venv folder already exists, skipping creation...
)
call .\venv\Scripts\activate.bat

python -m pip install --upgrade pip

python -m pip install paddlepaddle-gpu==2.4.2.post117 -f https://www.paddlepaddle.org.cn/whl/windows/mkl/avx/stable.html

python -m pip install torch torchvision --index-url https://download.pytorch.org/whl/cu121

pip install -r requirements.txt