Open croros opened 5 years ago
the same question as you, if I load trained model, it seems that it is loaded into ssd_net, while we continue to train net...
My personal opinion is that the use of two different names is related to nn.DataParallel.
I don't know precisely, but when we use nn.DataParallel, sometimes data loading and saving become problematic.
So, to avoid such a problem, in the code ssd_net is used only for loading, saving, initializing etc., while net is wrapped by net = torch.nn.Dataparallel(ssd_net) and is used only for training and evaluation.
In train.py there is the following line:
net = ssd_net
And bothnet
andssd_net
are used in the lines following this one.From my understanding
net
is a shallow copy of ofssd_net
. Is there a reason to use both? Just seems to be more confusing to use two different names for the same data (unless I am missing something)