Does your code run fine without setting the start method explicitly?
Also, could you wrap your code in the if-clause:
import torch

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

if __name__ == '__main__':
    main()