You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 31, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Oct 31, 2023. It is now read-only.
lib/python3.9/site-packages/higher-0.2.1-py3.9.egg/higher/patch.py in _make_functional(module, params_box, params_offset, root_patched)
217
218 # type checking of next line disabled as mypy is iffy with dynamic types
--> 219 class MonkeyPatched(_ModuleType, _MonkeyPatchBase): # type: ignore
220 __metaclass__=makecls()
221 _wrapped_name = type(module).__name__
TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases
It appears that this trick is causing the issue, redefining the individual blocks (such as ResBlock) inheriting from torch.nn.Module seems to get rid of the error.
I met the same issue when defining my own metaclass. Can you explain to me how to deal with this issue?
I don't quite understand the trick mentioned above.
Activity
[-]metaclass issue[/-][+]metaclass issue with tsai[/+][-]metaclass issue with tsai[/-][+]metaclass issue with fastai[/+]shayanfazeli commentedon Aug 3, 2021
It appears that this trick is causing the issue, redefining the individual blocks (such as ResBlock) inheriting from
torch.nn.Moduleseems to get rid of the error.Stanwang1210 commentedon Mar 2, 2023
I met the same issue when defining my own metaclass. Can you explain to me how to deal with this issue?
I don't quite understand the trick mentioned above.
jeevster commentedon Mar 7, 2023
I'm also seeing the same issue with a custom model which is a torch.nn.Module. I didn't understand the trick mentioned above. Any suggestions?
Stanwang1210 commentedon Mar 8, 2023
It seems like we can't use higher on model which inherits custom metaclass. I solve this issue by remove the meta class of my model.