eriklindernoren / PyTorch-GAN

PyTorch implementations of Generative Adversarial Networks.
MIT License
16.52k stars 4.09k forks source link

Question about error for context encoder #190

Closed IvanChen777 closed 2 years ago

IvanChen777 commented 2 years ago

Hi, I have a question about the error for context encoder, when I follow the instruction to train the model, I met such issue, that is: 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.

Does someone knows how to solve this problem? Thank you in advance!

IvanChen777 commented 2 years ago

Problem is solved, it is because this context_encoder.py is missing a line(if name=='main')