Louis-udm / VGCN-BERT

MIT License
121 stars 35 forks source link

There is a problem when I train models #6

Open soutlu opened 4 years ago

soutlu commented 4 years ago

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.
chenkaixin66 commented 3 years ago

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

89x98 commented 2 years ago

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