Closed ChiaraMC closed 2 years ago
Just realised I had missed one other line that had to be changed in mhop_loss()
, I changed it now
Hi @ChiaraMC, the module attribute once you used dataparrallel. Can you try run the code using multiple gpus.
Hey @xwhan , yes sorry I only realised once I used it with multiple gpus. This should now work with both one and multiple gpus. However, I think it might look cleaner to use DataParallel even for the case with just 1 gpu? It would save always having to specify if n_gpu > 1 ...
I haven't used DataParallel before though so not sure if this would bring other issues
In
train_momentum.py
model
is an instance ofRobertaMomentumRetriever
. In a few places the script callsmodel.module.encoder_q.state_dict()
, as well asmodel.module.queue.clone().detach().t()
frommdr.retrieval.criterions.mhop_loss
. However,RobertaMomentumRetriever
doesn't actually have amodule
attribute, so the script throws an error. I believe these should be replaced withmodel.encoder_q.state_dict()
andmodel.queue.clone().detach().t()