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

Add support for win 64-bit #11

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add support for win 64-bit #11

wants to merge 2 commits into from

Conversation

computermacgyver
Copy link
Member

@computermacgyver computermacgyver commented Oct 27, 2020

Per #10 , the multiprocessing in pytorch requires that

  1. The contents of my main program are within a
if __name__ == "__main__":

block
2. The first statement of that block is freeze_support()
3. The freeze_support function is imported from multiprocessing, i.e.,

from multiprocessing import freeze_support

I've adapted scripts/m3twitter.py and scripts/preprocess.py to follow this convention.

I have confirmed these changes have no effect on linux (as intended), but do not have access to a 64-bit windows machine to test.
(I have an old virtual box with a 32-bit install of windows but pytorch is not available for 32-bit systems)

@computermacgyver computermacgyver added the bug Something isn't working label Oct 27, 2020
@computermacgyver computermacgyver self-assigned this Oct 27, 2020
@zijwang
Copy link
Member

zijwang commented Nov 2, 2020

Thanks @computermacgyver for making the changes. From here, it looks like the code needs to be refactored into the following structure

import torch

def main()
    for i, data in enumerate(dataloader):
        # do something here

if __name__ == '__main__':
    main()

I unfortunately also don't have a windows machine to test things out. We could wait @anudeike to see whether the current changes work, and if not, we may try the recommended structure.

@computermacgyver
Copy link
Member Author

Nice find on that documentation. I think that looks good and will do both that pattern and freeze_support. I wonder if I can spin up a Windows machine in the cloud---I'll see whats possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hacktoberfest-accepted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants