Open computermacgyver opened 3 years ago
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.
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.
Per #10 , the multiprocessing in pytorch requires that
block
freeze_support()
I've adapted
scripts/m3twitter.py
andscripts/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)