Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

freeze_support() issue #6

Open
bobstone94 opened this issue Mar 31, 2020 · 9 comments
Open

freeze_support() issue #6

bobstone94 opened this issue Mar 31, 2020 · 9 comments

Comments

@bobstone94
Copy link

Anyone know how to fix this issue?

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.
@max-mauermann
Copy link

Have you found a solution for this? I am having the same Issue.
Are you running this on Windows?
I am not sure if this is supposed to run on Windows, because according to this: https://stackoverflow.com/questions/18204782/runtimeerror-on-windows-trying-python-multiprocessing
"On Windows the subprocesses will import (i.e. execute) the main module at start", which is messing with the rest of the code.

It is working without multiprocessing (you will need to change the code at the end), but this will be extremely slow, which may be ok for small datasets.

@LucFrachon
Copy link

LucFrachon commented Apr 13, 2020

Hi @bobstone94 and @max-mauermann
I found a workaround to this problem. I simply execute the code in the Ubuntu Bash for Windows terminal (it ships with Windows 10). See this link for instance for instructions.
From the Ubuntu Bash, install matplotlib, numpy and requests using pip.
Then navigate to /mnt/<drive_letter>/<folder_path> where you downloaded the ImageNet Downloader (this repo) and execute from there. It works with multiprocessing.

@max-mauermann
Copy link

That's actually a nice solution, thanks.
I solved it by rewriting the code to run under windows and it seems to work.

@skaldek
Copy link

skaldek commented May 16, 2020

Fixed in my fork. If suddenly someone else needs it.

@ILYSHI
Copy link

ILYSHI commented Jun 2, 2021

Fixed in my fork. If suddenly someone else needs it.

It only creates folders with no images inside.

@ILYSHI
Copy link

ILYSHI commented Jun 2, 2021

Same problem on Mac OS

@rickkk856
Copy link

Fixed in my fork. If suddenly someone else needs it.

IF you gitclone this repo and change line 39 in downloader.py to:
return f'http://www.image-net.org/api/imagenet.synset.geturls?wnid={wnid}'

It will work on windows

@skaldek
Copy link

skaldek commented Jul 13, 2021

@rickkk856, merged your changes.

@tsbhun98
Copy link

tsbhun98 commented Oct 1, 2022

@skaldek your solution saved me from a lot of trouble. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants