У меня есть специальная оболочка в сети Caffe, и я пытаюсь ее мариновать. Используемая мной оболочка имеет лямбда-функцию, и поэтому я использую библиотеку dill
. К сожалению, я не могу опубликовать сетевой источник, но ниже приведен пример того, как я пытаюсь его сбросить.
Пример источника -
import sys
import dill as pickle
# assume the network_obj has already been instantiated
sys.setrecursionlimit(50000)
pickle.dump(network_obj, open("networks/network.p", "wb"))
Ниже приведена ошибка, которую я получаю
Windows fatal exception: stack overflow
Current thread 0x00003ad4 (most recent call first):
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\site-packages\dill\_dill.py", line 908 in save_module_dict
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 476 in save
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 634 in save_reduce
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 521 in save
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 808 in _batch_appends
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 781 in save_list
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 476 in save
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 847 in _batch_setitems
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 821 in save_dict
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\site-packages\dill\_dill.py", line 912 in save_module_dict
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 476 in save
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 634 in save_reduce
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 521 in save
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 808 in _batch_appends
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 781 in save_list
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 476 in save
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 847 in _batch_setitems
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 821 in save_dict
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\site-packages\dill\_dill.py", line 912 in save_module_dict
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 476 in save
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 634 in save_reduce
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 521 in save
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 808 in _batch_appends
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 781 in save_list
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 476 in save
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 847 in _batch_setitems
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 821 in save_dict
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\site-packages\dill\_dill.py", line 912 in save_module_dict
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 476 in save
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 634 in save_reduce
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 521 in save
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 808 in _batch_appends
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 781 in save_list
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 476 in save
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 847 in _batch_setitems
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 821 in save_dict
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\site-packages\dill\_dill.py", line 912 in save_module_dict
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 476 in save
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 634 in save_reduce
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 521 in save
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 808 in _batch_appends
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 781 in save_list
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 476 in save
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 847 in _batch_setitems
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 821 in save_dict
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\site-packages\dill\_dill.py", line 912 in save_module_dict
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 476 in save
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 634 in save_reduce
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 521 in save
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 808 in _batch_appends
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 781 in save_list
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 476 in save
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 847 in _batch_setitems
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 821 in save_dict
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\site-packages\dill\_dill.py", line 912 in save_module_dict
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 476 in save
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 634 in save_reduce
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 521 in save
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 808 in _batch_appends
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 781 in save_list
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 476 in save
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 847 in _batch_setitems
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 821 in save_dict
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\site-packages\dill\_dill.py", line 912 in save_module_dict
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 476 in save
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 634 in save_reduce
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 521 in save
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 808 in _batch_appends
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 781 in save_list
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 476 in save
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 847 in _batch_setitems
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 821 in save_dict
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\site-packages\dill\_dill.py", line 912 in save_module_dict
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 476 in save
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 634 in save_reduce
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 521 in save
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 808 in _batch_appends
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 781 in save_list
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 476 in save
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 847 in _batch_setitems
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 821 in save_dict
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\site-packages\dill\_dill.py", line 912 in save_module_dict
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 476 in save
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 634 in save_reduce
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 521 in save
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 808 in _batch_appends
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 781 in save_list
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 476 in save
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 847 in _batch_setitems
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 821 in save_dict
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\site-packages\dill\_dill.py", line 912 in save_module_dict
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 476 in save
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 634 in save_reduce
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 521 in save
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 808 in _batch_appends
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 781 in save_list
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 476 in save
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 847 in _batch_setitems
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\pickle.py", line 821 in save_dict
File "C:\Users\amitpras\Workspace\my_proj\.env\lib\site-packages\dill\_dill.py", line 912 in save_module_dict
Какая может быть возможная причина?