Asthestarsfalll / ExCore

A Modern Configuration/Registry System designed for deeplearning, with some utils.
https://excore.onism.space/
MIT License
13 stars 0 forks source link

Reduce unnecessary imports #8

Closed Asthestarsfalll closed 1 year ago

Asthestarsfalll commented 1 year ago

Registry is a great design, but when the project become more and more huge, such a static design requires us to import all the python files which contains Registry. So this is a compromise solution which I call LazyRegistry. The LazyRegistry only register all modules for the first time, and it does not map the string to object any more, instead it will map the string to string, such as ResNet -> src.modeling.bacbone.ResNet. It will dump all Registry to binary cached file into default cache_dir. Before parsing configs, the cached file will be loaded.