admin管理员组文章数量:1130349
在google colab 的命令行执行程序,一直报cannot schedule new futures after interpreter shutdown
之前在别的服务器上就没事
程序的执行顺序
run.py > importlib.import_module(需要执行的文件) > 传给 threading.Thread
在importlib.import_module(需要执行的文件) 这一步里,用到了
from concurrent.futures import ThreadPoolExecutor
就一直报上面的错误,后来发现是run.py 执行完就退出了,所以线程池关闭了,在run.py里,加上这个,每个线程都join,就好了
for thread in threads:
thread.join()
在google colab 的命令行执行程序,一直报cannot schedule new futures after interpreter shutdown
之前在别的服务器上就没事
程序的执行顺序
run.py > importlib.import_module(需要执行的文件) > 传给 threading.Thread
在importlib.import_module(需要执行的文件) 这一步里,用到了
from concurrent.futures import ThreadPoolExecutor
就一直报上面的错误,后来发现是run.py 执行完就退出了,所以线程池关闭了,在run.py里,加上这个,每个线程都join,就好了
for thread in threads:
thread.join()
本文标签: futuresscheduleshutdowninterpreter
版权声明:本文标题:cannot schedule new futures after interpreter shutdown 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/jiaocheng/1755000755a2752142.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论