The code looks alright, but again I would recommend to use isinstance
instead of the name check.
Note that model.eval()
will also disable dropout layers (any maybe change the behavior of custom layers), so you might want to call eval()
only on the batchnorm layers.
3 Likes