保存模型报错:RecursionError: maximum recursion depth exceeded
时间: 2024-04-27 11:20:25 浏览: 291
回答: 当保存模型时出现了"RecursionError: maximum recursion depth exceeded"的错误,这个错误通常是由于递归深度超过了Python默认的最大递归深度1000导致的。解决这个问题的一种方法是通过设置递归深度来增加Python的最大递归深度。在PaddleOCR的源代码中,可以通过在ppocr\data\simple_dataset.py中添加以下代码来设置递归深度:
import sys
sys.setrecursionlimit(3000) #设置递归深度。可以通过检查代码中的错误触发条件和递归调用的情况来解决问题。
综上所述,当保存模型时出现"RecursionError: maximum recursion depth exceeded"的错误,可以通过增加递归深度或修复源代码中的递归问题来解决。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [python报错:RecursionError: maximum recursion depth exceeded in comparison](https://blog.csdn.net/weixin_53374931/article/details/129660414)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [【百度PaddleOCR踩坑】报错:RecursionError: maximum recursion depth exceeded while calling a Python ...](https://blog.csdn.net/HEYUDAGE/article/details/126219497)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文