-
below is my code from mmengine.dataset import COLLATE_FUNCTIONS as MMENGINE_COLLATE_FUNCTIONS
COLLATE_FUNCTIONS = Registry(
'Collate Functions',
parent=MMENGINE_COLLATE_FUNCTIONS,
locations=['myproject.datasets'],
) and @COLLATE_FUNCTIONS.register_module()
def mycollate(data_batch, *args, **kwargs):
pass and in myconfig.py collate = dict(
type='mycollate',
)
train_dataloader=dict(collate=collate,...) but, default runner will report error at mmengine/mmengine/runner/runner.py Line 1402 in 5753cd9 so, what is the best way to use mycollate? |
Beta Was this translation helpful? Give feedback.
Answered by
C1rN09
Feb 1, 2023
Replies: 1 comment
-
There is an issue with Honestly speaking, this behavior is kind of weird. We will try to find a better solution in the future. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Fei-Wang
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is an issue with
Registry.get()
method that it will not infer scopes asRegistry.build()
do. As a result, you have to register yourmycollate
to MMEngine's own root registry rather than your child registry.Honestly speaking, this behavior is kind of weird. We will try to find a better solution in the future.