How to reach model attributes wrapped by nn.DataParallel?

When you wrap a model with DataParallel,
the model.module can be seen as the model before it’s wrapped.

You can use model.module.attribute to reach the model attribute like before.

14 Likes