请教pycharm报错RecursionError: maximum recursion depth exceeded如何解决

代码是

from nets.unet import mobilenet_unet

if __name__ == "__main__":
    model = mobilenet_unet(2, input_height=416, input_width=416)
    model.summary()

运行之后报错

D:\anaconda3\envs\tensorflow-gpu\python.exe D:/myproject/Semantic-Segmentation-master/Semantic-Segmentation-master/UM/test.py
Using TensorFlow backend.
D:\anaconda3\envs\tensorflow-gpu\lib\site-packages\tensorflow\python\framework\dtypes.py:526: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint8 = np.dtype([("qint8", np.int8, 1)])
D:\anaconda3\envs\tensorflow-gpu\lib\site-packages\tensorflow\python\framework\dtypes.py:527: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
D:\anaconda3\envs\tensorflow-gpu\lib\site-packages\tensorflow\python\framework\dtypes.py:528: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint16 = np.dtype([("qint16", np.int16, 1)])
D:\anaconda3\envs\tensorflow-gpu\lib\site-packages\tensorflow\python\framework\dtypes.py:529: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
D:\anaconda3\envs\tensorflow-gpu\lib\site-packages\tensorflow\python\framework\dtypes.py:530: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint32 = np.dtype([("qint32", np.int32, 1)])
D:\anaconda3\envs\tensorflow-gpu\lib\site-packages\tensorflow\python\framework\dtypes.py:535: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  np_resource = np.dtype([("resource", np.ubyte, 1)])
Traceback (most recent call last):
  File "D:/myproject/Semantic-Segmentation-master/Semantic-Segmentation-master/UM/test.py", line 11, in <module>
    model = mobilenet_unet(2, input_height=416, input_width=416)
  File "D:\myproject\Semantic-Segmentation-master\Semantic-Segmentation-master\UM\nets\unet.py", line 56, in mobilenet_unet
    model =  _unet(n_classes, get_mobilenet_encoder, input_height=input_height, input_width=input_width)
  File "D:\myproject\Semantic-Segmentation-master\Semantic-Segmentation-master\UM\nets\unet.py", line 7, in _unet
    model = _unet(n_classes, get_mobilenet_encoder, input_height=input_height, input_width=input_width)
  File "D:\myproject\Semantic-Segmentation-master\Semantic-Segmentation-master\UM\nets\unet.py", line 7, in _unet
    model = _unet(n_classes, get_mobilenet_encoder, input_height=input_height, input_width=input_width)
  File "D:\myproject\Semantic-Segmentation-master\Semantic-Segmentation-master\UM\nets\unet.py", line 7, in _unet
    model = _unet(n_classes, get_mobilenet_encoder, input_height=input_height, input_width=input_width)
  [Previous line repeated 995 more times]
RecursionError: maximum recursion depth exceeded

Process finished with exit code 1

在网上搜了解决方法是在代码前加


import sys
sys.setrecursionlimit(2000000000) #设置递归深度

但是又报错

D:\anaconda3\envs\tensorflow-gpu\python.exe D:/myproject/Semantic-Segmentation-master/Semantic-Segmentation-master/UM/test.py
Using TensorFlow backend.
D:\anaconda3\envs\tensorflow-gpu\lib\site-packages\tensorflow\python\framework\dtypes.py:526: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint8 = np.dtype([("qint8", np.int8, 1)])
D:\anaconda3\envs\tensorflow-gpu\lib\site-packages\tensorflow\python\framework\dtypes.py:527: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
D:\anaconda3\envs\tensorflow-gpu\lib\site-packages\tensorflow\python\framework\dtypes.py:528: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint16 = np.dtype([("qint16", np.int16, 1)])
D:\anaconda3\envs\tensorflow-gpu\lib\site-packages\tensorflow\python\framework\dtypes.py:529: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
D:\anaconda3\envs\tensorflow-gpu\lib\site-packages\tensorflow\python\framework\dtypes.py:530: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint32 = np.dtype([("qint32", np.int32, 1)])
D:\anaconda3\envs\tensorflow-gpu\lib\site-packages\tensorflow\python\framework\dtypes.py:535: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  np_resource = np.dtype([("resource", np.ubyte, 1)])

Process finished with exit code -1073741571 (0xC00000FD)

环境是Win10+tensorflow1.13.2+keras2.1.5+python3.6
请问到底是哪里错了,应该怎么解决啊?

把mobilenet_unet的参数值改小还会储秀安这条的提示吗

提示的意思就是递归次数太多了,可能会无休止,所以程序报错了

请问这个问题解决了嘛

import sys
sys.setrecursionlimit(100000) #例如这里设置为十万。
还是报错
进程已结束,退出代码-1073741571 (0xC00000FD)
这个怎么解决,我试着降低requests版本也不行