You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thank you for the great work you've published. I am trying to train EVA 2 on a custom object detection dataset and noticed that the *_p14to16 pre-trained models are only available for EVA-B and EVA_L (in this table), but not for the other model sizes. I am trying to use the smaller EVA S and/or Ti models instead. As far as I understand, the conversion from p14 to p16 involves a linear interpolation of the pos_embed parameters, as mentioned here. This would mean that it could also be applied as a post-processing step of the checkpoint file for the smaller models.
I have tried to do the interpolation myself, by using the interpolate_patch_14to16.py script. However, this does not seem to work for the EVA 2 checkpoints, because of an error in accessing key values in the checkpoint:
I am not quite sure if applying the script would be the right approach to take or if another approach is necessary. Could you provide any feedback on this? Thanks in advance!
The text was updated successfully, but these errors were encountered:
I think I found a decent solution. The interpolate_patch_14to16.py script can be modified in the following way:
The p14 checkpoints contain the weights under the module key, not model. I.e. use checkpoint['module'] instead of checkpoint['model'].
Bicubic interpolation does not work for half float16 precision. As far as I can see, this can be solved by converting to float32 as an intermediary step. I.e.:
pos_tokens=pos_tokens.float() # convert to float32 because float16 is not supported for bicubic interpolationpos_tokens=torch.nn.functional.interpolate(
pos_tokens, size=(new_size, new_size), mode='bicubic', align_corners=False)
pos_tokens=pos_tokens.half() # convert back to float16
While there is already the .float(), making the interpolate correctly work, the .half()to convert back to float16 is missing. Btw, thanks for the hint!
Hi,
First of all, thank you for the great work you've published. I am trying to train EVA 2 on a custom object detection dataset and noticed that the
*_p14to16
pre-trained models are only available for EVA-B and EVA_L (in this table), but not for the other model sizes. I am trying to use the smaller EVA S and/or Ti models instead. As far as I understand, the conversion fromp14
top16
involves a linear interpolation of thepos_embed
parameters, as mentioned here. This would mean that it could also be applied as a post-processing step of the checkpoint file for the smaller models.I have tried to do the interpolation myself, by using the interpolate_patch_14to16.py script. However, this does not seem to work for the EVA 2 checkpoints, because of an error in accessing key values in the checkpoint:
I am not quite sure if applying the script would be the right approach to take or if another approach is necessary. Could you provide any feedback on this? Thanks in advance!
The text was updated successfully, but these errors were encountered: