VGCN-BERT icon indicating copy to clipboard operation
VGCN-BERT copied to clipboard

There is a problem when I train models

Open soutlu opened this issue 4 years ago • 2 comments

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

    This probably means that you are not using fork to start your
    child processes and you have forgotten to use the proper idiom
    in the main module:

        if __name__ == '__main__':
            freeze_support()
            ...

    The "freeze_support()" line can be omitted if the program
    is not going to be frozen to produce an executable.

soutlu avatar Sep 24 '20 11:09 soutlu

I also happend the same problem,have you fixed this?

chenkaixin66 avatar Oct 14 '21 01:10 chenkaixin66

I also happend the same problem,have you fixed this?

The generation of this problem is due to the problem of multi-threads under Windows, and the DataLoader class, the specific details https://github.com/pytorch/pytorch/pull/5585

You can solve this issue by modifying the Num_Workers parameter when calling the Torch.Utils.Data.DataLoader() function.

Modify num_works=4 --> num_works=0

or Place the block of code you want to run in the main function

if __name__ == '__main__':
	#your code

89x98 avatar Jan 28 '22 05:01 89x98