I think it is better to use the above shown approach with model.eval() as eval() not only affects Dropout.
As model.apply() uses children() to iterate through the models, it may not affect nested layers.
Therefore it is better to use modules(). Also, if you like to set all Dropout layers and not only nn.Dropout2d to training mode you can use:
def enable_eval_dropout(model):
	for module in model.modules():
		if 'Dropout' in type(module).__name__:
			module.train()