用uWSGI +Flask多进程多线程部署你的深度学习应用时,访问会报这样的错
"Cannot re-initialize CUDA in forked subprocess. To use CUDA with "
RuntimeError: Cannot re-initialize CUDA in forked subprocess. To use CUDA with multiprocessing, you must use the 'spawn' start method
查了半天,终于查到怎么使用spawn方法而不是fork
在uWSGI的配置文件中,添加 lazy=true 即可