PaddlePaddle / PaddleSeg

Easy-to-use image segmentation library with awesome pre-trained model zoo, supporting wide-range of practical tasks in Semantic Segmentation, Interactive Segmentation, Panoptic Segmentation, Image Matting, 3D Segmentation, etc.
https://arxiv.org/abs/2101.06175
Apache License 2.0
8.69k stars 1.68k forks source link

选择nv-gpu推理 无法选中,只能进行cpu推理 #3725

Closed alanxinn closed 5 months ago

alanxinn commented 5 months ago

问题确认 Search before asking

请提出你的问题 Please ask your question

推理脚本 python tools/predict.py --config configs/quick_start/pp_liteseg_optic_disc_512x512_1k.yml --model_path https://paddleseg.bj.bcebos.com/dygraph/optic_disc/pp_liteseg_optic_disc_512x512_1k/model.pdparams --image_path docs/images/optic_test_image.jpg --save_dir output/result --device gpu --device_id 0

------------Environment Information------------- platform: Windows-10-10.0.19045-SP0 Python: 3.9.19 (main, May 6 2024, 20:12:36) [MSC v.1916 64 bit (AMD64)] Paddle compiled with cuda: True NVCC: Build cuda_11.2.r11.2/compiler.29618528_0 cudnn: 8.2 GPUs used: 1 CUDA_VISIBLE_DEVICES: None GPU: ['GPU 0: NVIDIA GeForce'] PaddleSeg: 2.8.0 PaddlePaddle: 2.5.2 OpenCV: 4.5.5

CUDA_VISIBLE_DEVICES: None 是因为这个无法找到cuda支持设备,导致无法使用gpu推理吗?

paddlepaddle安装自检

(paddleseg) C:\Users\gw>python Python 3.9.19 (main, May 6 2024, 20:12:36) [MSC v.1916 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.

import paddle paddle.utils.run_check() Running verify PaddlePaddle program ... I0524 11:51:16.795454 7828 interpretercore.cc:237] New Executor is Running. W0524 11:51:16.795454 7828 gpu_resources.cc:119] Please NOTE: device: 0, GPU Compute Capability: 7.5, Driver API Version: 12.4, Runtime API Version: 11.2 W0524 11:51:16.801437 7828 gpu_resources.cc:149] device: 0, cuDNN Version: 8.2. I0524 11:51:18.545151 7828 interpreter_util.cc:518] Standalone Executor is Used. PaddlePaddle works well on 1 GPU. PaddlePaddle is installed successfully! Let's start deep learning with PaddlePaddle now.

cuda版本 11.2
cudnn 8.2.1

alanxinn commented 5 months ago

gpu 1060 3g paddlepaddle-gpu=2.4.2 cuda11.2 cudnn8.2.1 python=3.8

配置成功

2024-05-24 12:06:14 [INFO] Set device: gpu:0 2024-05-24 12:06:14 [INFO] Use the following config to build model model: backbone: pretrained: https://bj.bcebos.com/paddleseg/dygraph/PP_STDCNet2.tar.gz type: STDC2 num_classes: 2 type: PPLiteSeg W0524 12:06:14.790144 22364 gpu_resources.cc:61] Please NOTE: device: 0, GPU Compute Capability: 7.5, Driver API Version: 12.4, Runtime API Version: 11.2 W0524 12:06:14.791117 22364 gpu_resources.cc:91] device: 0, cuDNN Version: 8.2. 2024-05-24 12:06:15 [INFO] Loading pretrained model from https://bj.bcebos.com/paddleseg/dygraph/PP_STDCNet2.tar.gz 2024-05-24 12:06:15 [INFO] There are 265/265 variables loaded into STDCNet. 2024-05-24 12:06:15 [INFO] The number of images: 1 2024-05-24 12:06:15 [INFO] Loading pretrained model from https://paddleseg.bj.bcebos.com/dygraph/optic_disc/pp_liteseg_optic_disc_512x512_1k/model.pdparams 2024-05-24 12:06:16 [WARNING] ppseg_head.arm_list.0._scale is not in pretrained model 2024-05-24 12:06:16 [WARNING] ppseg_head.arm_list.1._scale is not in pretrained model 2024-05-24 12:06:16 [WARNING] ppseg_head.arm_list.2._scale is not in pretrained model 2024-05-24 12:06:16 [INFO] There are 367/370 variables loaded into PPLiteSeg. 2024-05-24 12:06:16 [INFO] Start to predict... 1/1 [==============================] - 1s 1s/step 2024-05-24 12:06:17 [INFO] Predicted images are saved in output/result\added_prediction and output/result\pseudo_color_prediction

Qiuyanghang commented 5 months ago

你好,我也遇到了该问题,请问怎么解决?感谢回复

alanxinn commented 5 months ago

你好,我也遇到了该问题,请问怎么解决?感谢回复

上面的配置成功了

Qiuyanghang commented 5 months ago

你好,我也遇到了该问题,请问怎么解决?感谢回复

上面的配置成功了

是版本不匹配的原因吗?我的是python版本:3.9 paddlepaddle-gpu版本: 2.6.1.post116 paddleseg版本:2.8.0 cuda版本:11.6,一张3060的显卡

alanxinn commented 5 months ago

paddle版本用2.4.2的 python用3.8试试看

Qiuyanghang commented 5 months ago

好的好的,感谢