-
I'm trying to create a swarm_cse_pt job with brats data/learner. When directly replacing the cifar10-learner (in Swarm Learning example) with brats-learner (in Brats18 example), I got an error: I noticed in Swarm Learning example (job_templates/swarm_cse_pt/config_fed_client.json), ModelLearnerExecutor was used for cifar10-learner:
while in Brats18 example (examples/advanced/brats18/configs/brats_fedavg/app/config/config_fed_client.json), LearnerExecutor was used for brats-learner:
But when I tried to pair ModelLeanerExecutor with brats-learner in my configuration, I got following error: Is there any way I can modify the brats-learner (supervised_monai_brats_learner) so that it can be paired with ModelLearnerExecutor (i.e. support submit_model task), or maybe there is a "ModelLearner version" of brats-learner already predefined somewhere? Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@jingyunc as of now, we have only one example of ModelLearner: https://github.com/NVIDIA/NVFlare/blob/main/examples/advanced/cifar10/pt/learners/cifar10_model_learner.py Feel free to write your own ModelLearner for brats. Another thing you could do is switch the ModelLearnerExecutor to LearnerExecutor, then you don't need to write your own ModelLearner for brats. LearnerExectuor also support submit_model task: https://github.com/NVIDIA/NVFlare/blob/main/nvflare/app_common/executors/learner_executor.py#L121 |
Beta Was this translation helpful? Give feedback.
Adding to above, if choosing to switch to use
LearnerExecutor
and modify the currentSupervisedMonaiBratsLearner
to supportsubmit_model task
, you would need to implementget_model_for_validation()
which retrieves the best local model saved from training.Currently, the model is not being saved locally, but you can reference https://github.com/NVIDIA/NVFlare/blob/main/examples/advanced/cifar10/pt/learners/cifar10_learner.py#L311 to see how this logic can be done in a Learner.