RuntimeError: An attempt has been made to start a new process before the current process...

When doing hands-on deep learning-softmax regression from scratch, I encountered this problem in pycharm. The
error message is as follows:
insert image description here
Reason: Multiple processes need to run in the main function.

Solution:

Add the main function and call it in the main.
Put all the code in the main function body and execute it.
insert image description here
Then add this in the circle below at the end. Remember to import the sys package at the beginning.

After finishing, ctrl+alt+L shortcut keys to adjust the format, and no error will be reported.

insert image description here
Reference link: http://php-note.com/1837.html

Guess you like

Origin blog.csdn.net/m0_50736744/article/details/121871480