junyanz / pytorch-CycleGAN-and-pix2pix

Image-to-Image Translation in PyTorch
Other
23.09k stars 6.32k forks source link

Cannot create dataset for Pix2Pix #1480

Closed mykeehu closed 2 years ago

mykeehu commented 2 years ago

Hello,

I have newly installed the program, using conda installation in enviroment. After enviroment I created the necessary folders, copied the A and B PNG files into the train directories like this:

A |-test <--my test pix here |-train <--my train pix here |-val

and same structure in B

I then ran this command:

python datasets/combine_A_and_B.py --fold_A aaa/pix/A --fold_B aaa/pix/B --fold_AB aaa/pix

and I got this error:

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.

Do I need to modify the file or what have I entered wrong? I am using Windows 10.

nckp commented 2 years ago

You can get around this error by using the --no_multiprocessing flag

mykeehu commented 2 years ago

Thank you for solution! I thought this was only true for CPU mode, and since I wanted to process it with GPU, I didn't type it.