I was trying to visualize the first layer of my resnet models. However, I am not very sure whether my current approach is fine:
first_layer = model.conv1
filters = torchvision.utils.make_grid(first_layer.weight.data, padding=5, pad_value=255)

import matplotlib.pyplot as plt
%matplotlib inline
plt.imshow((filters.detach().numpy()).transpose(1,2,0))

Is it that simple? However, when I used a not pretrained resnet101 model, all the filters will be black. Do I need to multiply ‘filters’ by 255?
(BTW, a pre-trained model using this method will turn out to have some red/green dots/strides)