Xiao-Chenguang / FedMind

Federated Learning framework for researcher on top of PyTorch.
https://github.com/Xiao-Chenguang/FedMind
MIT License
1 stars 0 forks source link

method starts with double underscore not found error when inherient from FedAlg #37

Closed Xiao-Chenguang closed 1 month ago

Xiao-Chenguang commented 1 month ago

When trying to custom the FL algorithm based on FedAlg, some methods and property are not correctly inherited from the base class FedAlg. This issue happened to self.__task_queue, self.__wb_run.

Xiao-Chenguang commented 1 month ago

This seems to be related to Name mangling in Python. Double underscore started methods and attributes are not directly accessible outside the class. As the name is prefixed with the class name when referred to. See https://stackoverflow.com/questions/15738086/issue-with-python-single-and-double-underscore-variables for more detail.