0

Is there are direct way to convert a trained RGB resnet50 mxnet model to grayscale. I'm just looking so save some CPU cycles not having to process 3 channels in the the first layer since my input images are grayscale anyway. I'd also like to avoid having to stack 3 grayscale images to create a 3 channel input.

Looking at the params, the first layer that seems to be 3 channels in pretty deep. Does this mean the channels are processed separately and only joined deeper in the model.

resnet50 params

I'm working with night vision images.

pkuhar
  • 581
  • 6
  • 17
  • 1
    you cannot. Since the layers are built for 3 channels and the weights are built for 3 channels you cannot do transfer learning. But you can look for the model architecture code, edit it for grayscale i.e. single channel (its going to be a rollercoaster) and try training with gray scale images. – venkata krishnan Nov 06 '19 at 01:43
  • @venkatakrishnan I'm trying to convert the weights to 1 channel without retraining. at least the first or the first couple layers. – pkuhar Nov 06 '19 at 15:20
  • may be this can help ? https://gist.github.com/mohapatras/5d720cb19014ed573bcd3ed36c5929f5 – venkata krishnan Nov 07 '19 at 02:34

0 Answers0