pytorch / examples

A set of examples around pytorch in Vision, Text, Reinforcement Learning, etc.

Home Page:https://pytorch.org/examples

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The order of the parameters is reversed. The two parameter (save_every, total_epochs)positions should be interchanged.

RuleNHao opened this issue · comments

mp.spawn(main, args=(world_size, args.total_epochs, args.save_every, args.batch_size), nprocs=world_size)

It took me hours to find the bug. This is an unforgettable experience.

And it also need to use sampler.set_epoch() method at the beginning of each epoch.

cc: @suraj813

@RuleNHao thanks for catching this!

set_epoch() is an important suggestion to ensure random shuffling; thank you for bringing this up, I'll update the example to include this.