Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Best parameters for BoQ-ResNet50 #7

Open
guipotje opened this issue Oct 7, 2024 · 0 comments
Open

Best parameters for BoQ-ResNet50 #7

guipotje opened this issue Oct 7, 2024 · 0 comments

Comments

@guipotje
Copy link

guipotje commented Oct 7, 2024

Hello @amaralibey, thank you for the amazing framework, the code is pretty easy to use!

I'm training a BoQ-ResNet-50 with the following parameters, for obtaining a 4096 descriptor dim. After 40 epochs, I'm obtaining slightly worse results than expected from BoQ repository README. Is there any parameter you recommend to adjust for some improvement? I reduced batch size to 64 to fit in my GPU, do you believe this may be the reason for reduced performance?

image

# ----------------------------------------------------------------------------
# Copyright (c) 2024 Amar Ali-bey
# # https://github.com/amaralibey/OpenVPRLab
# Licensed under the MIT License. See LICENSE file in the project root.
# ----------------------------------------------------------------------------


#---------------------------------------------------
# Datamodule Configuration
#---------------------------------------------------
datamodule:
  train_set_name: "gsv-cities" # use "gsv-cities" if you have downloaded the full dataset
  train_image_size: 
    - 320
    - 320
  val_image_size: 
    - 384
    - 384
  img_per_place: 4
  batch_size: 64
  num_workers: 8
  val_set_names:
    - "msls-val"
    - "pitts30k-val"

#---------------------------------------------------
# VPR Model Configuration
#---------------------------------------------------
backbone:
  module: src.models.backbones
  class: ResNet
  params:
    backbone_name: "resnet50"  # name of the resnet backbone (see ResNet.AVAILABLE_MODELS)
    pretrained: true
    num_unfrozen_blocks: 2
    crop_last_block: true
  
  # Example of DinoV2
  # name: dinov2
  # module: src.models.backbones
  # class: DinoV2
  # params:
  #   backbone_name: "dinov2_vitb14" # name of the vit backbone (see DinoV2.AVAILABLE_MODELS)
  #   num_unfrozen_blocks: 2

aggregator:
  module: src.models.aggregators # module path
  class: BoQ    # class name in the __init__.py file in the aggregators directory
  params:
    in_channels:  # if left blank we will use backbone.out_channels.
    proj_channels: 256
    num_queries: 32
    num_layers: 2
    row_dim: 16

#---------------------------------------------------
# Loss Function Configuration
#---------------------------------------------------
loss_function: 
  # check src/losses/vpr_losses.py for available loss functions, we are using pytorch_metric_learning library
  # if you want to develop your own loss function, you can add it to the vpr_losses.py file
  # or create a new file in the losses directory and import it into the __inin__.py file
  module: src.losses
  class: VPRLossFunction
  params:
    loss_fn_name: "MultiSimilarityLoss"   # other possible values: "SupConLoss", "ContrastiveLoss", "TripletMarginLoss"
    miner_name: "MultiSimilarityMiner"    # other possible values: "TripletMarginMiner", "PairMarginMiner"


#---------------------------------------------------
# Trainer Configuration
#---------------------------------------------------
trainer:
  optimizer: adamw
  lr: 0.0004      # learning rate
  wd: 0.001       # weight decay
  warmup: 1500    # linear warmup steps
  max_epochs: 40
  milestones:
    - 5
    - 10
    - 20
    - 30
  lr_mult: 0.25 # learning rate multiplier at each milestone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant