Skip to content

Obs register fix - #199

Merged
danfeiX merged 2 commits into
masterfrom
obs_register_fix
Oct 8, 2024
Merged

danfeiX merged 2 commits into
masterfrom
obs_register_fix

Conversation

@danfeiX

@danfeiX danfeiX commented Oct 7, 2024

Copy link
Copy Markdown
Collaborator

#190 introduced a bug into how we create observation backbones in obs_core.py by mistakenly referencing OBS_ENCODER_CORES defined in obs_utils.py. However, we do need a new registry for users to define their own obs encoder backbones such as ResNet18Conv. So here is a fix that does that.

  • Changes to utils/obs_utils.py and models/obs_cores.py

    • Added register_encoder_backbone function in robomimic/utils/obs_utils.py to register observation encoder backbones.
    • Introduced OBS_ENCODER_BACKBONES dictionary in robomimic/utils/obs_utils.py to store mappings of observation encoder network names to classes.
    • Updated the backbone_kwargs extraction in robomimic/models/obs_core.py to use OBS_ENCODER_BACKBONES instead of OBS_ENCODER_CORES.
  • Class Initialization Updates:

    • Added __init_subclass__ method to ConvBase class in robomimic/models/base_nets.py to automatically register subclasses as valid observation encoders.

@amandlek amandlek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@danfeiX
danfeiX merged commit 9273f9c into master Oct 8, 2024
@amandlek
amandlek deleted the obs_register_fix branch June 18, 2025 22:54
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

Successfully merging this pull request may close these issues.

Run test.sh with error bc-rgb-{}: failed with error: 'ResNet18Conv'

2 participants