DrSleep / tensorflow-deeplab-resnet

DeepLab-ResNet rebuilt in TensorFlow
MIT License
1.25k stars 429 forks source link

Restore partial weights after change input channels #56

Closed j50888 closed 7 years ago

j50888 commented 7 years ago

I want to add one additional channel(grey level image). So the channel size of input changes from 3 to 4. I want to restore the weights for the origin 3 channels. How can I do that?

I tried to do not restore the 'conv1' weights , but it can't converge.

DrSleep commented 7 years ago

I have written one possible solution here: https://gist.github.com/DrSleep/78c4e648343ba11ff32ceb2236b9f806#file-partial_restore-ipynb

Please adapt it as you wish for your case.

j50888 commented 7 years ago

Thank you for the help!