Could not load library cudnn_cnn_infer64_8.dll. Error code 193

原因:安装 16.1 CUDA 有区别需要到github再下载依赖才能适配使用 cuDNN
参考:https://www.pudn/news/62d7bc0d864d5c73acd326a0.html

验证:paddle 以及环境时候安装完成

import paddle
paddle.utils.run_check()

paddle.utils.run_check()已经success了但是执行脚本还是报 Could not load library cudnn_cnn_infer64_8.dll. Error code 193

是zlibwapi.dll 有问题,这paddle 把提示吞了
参考https://forums.developer.nvidia/t/could-not-load-library-cudnn-cnn-infer64-8-dll-error-code-193/218437/16

内存不够

Out of memory error on GPU 0. Cannot allocate 70.312500MB memory on GPU 0, 1.999817GB memory has been allocated and available memory is only 0.000000B.

Please check whether there is any other process using GPU 0.

  1. If yes, please stop them, or start PaddlePaddle on another GPU.
  2. If no, please decrease the batch size of your model.

加了参数改了batch_size

Train.loader.batch_size_per_card=1

swig 安装,放到path下了还是不行

参考 : https://blog.csdn/weixin_44566432/article/details/108912972
再安装量化工具的时候发现需要swig,安装了且设置了path但没用。

 pip install paddleslim==2.3.2

改用 conda安装

conda install swig

error: Microsoft Visual C++ 14.0 or greater is required. Get it with “Microsoft C++ Build Tools”: https://visualstudio.microsoft/visual-cpp-build-tools/

通过安装 Visual studio 来安装,需要选C++的桌面应用(没有的话先选C++的游戏,就有了)。

ValueError: Target 18 is out of upper bound.

这是在使用 特征提取https://aistudio.baidu/aistudio/projectdetail/4903130?contributionType=1 使用配置文件ser_vi_layoutxlm_udml.yml 是遇到的问题,通过修改 num_classes 解决,由17 改为了19。
但是当时直播分享说的是num_classes 值为 label数的 2n-1,我的label数是9不 知道为啥17不行。

数据集的 iters 值是怎么来的

日志示例:

[2022/11/01 09:46:24] ppocr INFO: train dataloader has 50 iters
[2022/11/01 09:46:24] ppocr INFO: valid dataloader has 10 iters

iters 的值 = 总训练图片数 / batch_size_per_card
可以通过调整 batch_size_per_card 来确定每次加载的数据量来最大化使用显卡内存。
也可以调整 num_workers的个数来最大化使用显卡内存。

如何增加训练集后继续训练

参考 https://github/PaddlePaddle/PaddleOCR/blob/release/2.6/doc/doc_ch/detection.md#22-%E6%96%AD%E7%82%B9%E8%AE%AD%E7%BB%83
目前看到三个参数 pretained model、checkpoint. 、 pretrain_weights。个人理解

  • Global.pretained_model:当前模型继续训练,其实就是加载预训练模型。
  • Global.checkpoint: 当前模型为base再训练新模型。一般用这个参数来进行评估、预测。
  • Global.pretrain_weights:断点继续训练,一般我看是直接配置的paddle的模型。

参考文字检测 pretained_model加载预训练模型、Global.checkpoints=./your/trained/model 端点训练。
读取checkpoints就会忽略pretrained_mode了。

参考 :https://github/PaddlePaddle/PaddleOCR/issues/2564
当前场景是又加了一批训练集,先拿 checkpoint试试。看来不好使,还是去下载了模型并且Hmean还是0。

更多推荐

Paddle 使用踩坑 + 记录