deepinsight / deepinsight/insightface
Fine-tune/train with four channel images
- Dominant language
- Python
- Stars
- 29.7k
- Forks
- 6.1k
- PR merge metrics
- No merged PRs in 30d
Description
Hi.
Thanks for this awesome repository and all your work involved in it.
I was wondering if it is possible to fine-tune your models using four channel images. In my particular case, I've already manipulated the data in order to have four channels instead of the classic three. Also, I've modified the image_iter.py so the "return io.DataBatch(...)" in the next(self) function, returns a batch_data of shape (batch_size, 4, 112, 112) instead of (batch_size, 3, 112, 112).
I've succesfully performed a lot of fine-tune with three channels data and your models previously, but when I try to execute this "four channels image" fine-tune I get the following error message:
MXNetError: Check failed: assign(&dattr, vec.at(i)): Incompatible attr in node at 0-th output: expected [32,4,112,112], got [32,3,112,112].
Also, if I modify the "self.provide_data" to have data_shape (4,112,112) instead of (3,112,112), I recieve the following error message:
MXNetError: Check failed: assign(&dattr, vec.at(i)): Incompatible attr in node at 0-th output: expected [64,3,3,3], got [64,4,3,3].
So I was wondering if it is possible to fine-tune your models with four channel data or it's just impossible and I have to train a model from scratch.
Finally, I was able to performe four channel data training from scratch (no pretrained model) with this modifications with no problem, but another issue appears. After verbose batches (i.e. evaluation time) the training is interrumpted and the following message shows up:
MXNetError: Shape of unspecifie arg: conv0_weight changed. This can cause the new executor to not share parameters with the old one. Please check for error in network.If this is intended, set partial_shaping=True to suppress this warning.
I'm presuming this is because my .bin files for evaluations where created from three channels images. Should I add a fourth channel to them also? Or am I missing something and it's possible to train with four channel data and validate on three channel data?
I know my questions are extensive and might be confusing, so let me know if there is any specific information I could provide to help me solve them.
Thanks in advance.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.