Cannot re-initialize CUDA in forked subprocess. To use CUDA with multiprocessing, you must use the 'spawn' start method
#24
by
manman
- opened
在linux上部署,按照其它教程添加如下代码
set_start_method('spawn', force=True)
logging.info("get_start_method:{}".format(torch.multiprocessing.get_start_method()))
虽然显示[I 230111 18:02:44 main:35] get_start_method:spawn
但是,依旧报错Cannot re-initialize CUDA in forked subprocess. To use CUDA with multiprocessing, you must use the 'spawn' start method,本地CPU是可以正常运行的