Closed tmralmeida closed 4 years ago
There was a bug in my code. Nevertheless, I changed the definitions of regression_headers and classification_headers to:
regression_headers = ModuleList([])
classification_headers = ModuleList([])
n_channels = [512, 1024, 512, 256, 256, 256]
for i in range(len(config.specs)):
ar = config.specs[i].aspect_ratios
if len(ar) == 1:
n = 4
else:
n = 6
regression_headers.append(Conv2d(n_channels[i], n * 4, kernel_size = 3, padding = 1))
classification_headers.append(Conv2d(n_channels[i], n * num_classes, kernel_size = 3, padding = 1))
This is less verbose and allows to use input sizes of 512*512.
Hello! i would like train SSD 512 but I don't know where should i make that changes. Could you help me?
The original priors specs are: specs = [ SSDSpec(38, 8, SSDBoxSizes(30, 60), [2]), SSDSpec(19, 16, SSDBoxSizes(60, 111), [2, 3]), SSDSpec(10, 32, SSDBoxSizes(111, 162), [2, 3]), SSDSpec(5, 64, SSDBoxSizes(162, 213), [2, 3]), SSDSpec(3, 100, SSDBoxSizes(213, 264), [2]), SSDSpec(1, 300, SSDBoxSizes(264, 315), [2]) ] But you do not use them. When I change to these priors, the number of priors are right: 8732 (generate_priors function is ok).
However, your regression_headers and classification_header sizes are fixed due to the hard coded "6 *" in the out_channels argument of each convolution layer. So, as you are doing the number of model's outputs will be always 3000. I'm trying to fix this with no success until now.