转载自:https://blog.csdn.net/Nin7a/article/details/104138036/,本文只做个人记录学习使用,版权归原作者所有。
Pycharm调试pytorch项目时出现类似标题的错误KeyboardInterrupt,很可能的一种原因是pycharm设置的问题,此类问题是由于在pycharm中开启了调试子线程的功能,在File->Settings->Building, Execution, Deployment->Python Debugger中,将Attach to subprocess automatically while debugging关闭即可。