bytedance / R2Former

Official repository for R2Former: Unified Retrieval and Reranking Transformer for Place Recognition
Apache License 2.0
83 stars 6 forks source link

dealing with one-channel input #15

Closed noahzn closed 10 months ago

noahzn commented 10 months ago

Hi, thanks for sharing the code!

If I want to input one-channel images and still use the pretrained DeiT, how should I modify the code? I tried changing in_chans=1 in class AnySizePatchEmbed, but encountered the channel problem. RuntimeError: Given groups=1, weight of size [384, 3, 16, 16], expected input[7, 1, 512, 512] to have 3 channels, but got 1 channels instead

Anuradha-Uggi commented 5 months ago

Hi. Try repeating the single channel across 3 channels and feed it to the model.