KaiyangZhou / Dassl.pytorch

A PyTorch toolbox for domain generalization, domain adaptation and semi-supervised learning.
MIT License
1.23k stars 171 forks source link

How to register the name into "TRAINER" registry'? I think I did everything correctly #55

Open gordonhu608 opened 1 year ago

gordonhu608 commented 1 year ago

Here is the error I got.

KeyError: 'Object name "CLIP_Adapter" does not exist in "TRAINER" registry' The new trainer file is here: https://github.com/gaopengcuhk/CLIP-Adapter/blob/main/clip_adapter.py

So does the Registry automatically detect the trainer if I used @TRAINER_REGISTRY.register() ?

KaiyangZhou commented 1 year ago

you need to put import clip_adapter somewhere in the main file so the compiler will find this line and compile the adapter code

sarthaxxxxx commented 4 months ago

I broke my head for 3-4 hours on this. Thanks a lot!