Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Script Changes Not Reflected During Execution in NVFlare #3060

Closed
falibabaei opened this issue Nov 11, 2024 · 2 comments
Closed

Custom Script Changes Not Reflected During Execution in NVFlare #3060

falibabaei opened this issue Nov 11, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@falibabaei
Copy link
Contributor

falibabaei commented Nov 11, 2024

I'm using a custom script for tf/fedopt_ctl with the example in my_new_home/NVFlare/examples/getting_started/tf. I commented out line 127 of the code in fedopt_ctl_10 , which should cause an error since num_trainable_weights is not defined, but strangely, I don't get any error and the execution continues.

To Reproduce
Steps to reproduce the behavior:

  1. Copy fed_ctl_10.py.
  2. In line 128 of tf_fl_script_runner_cifar10.py, change from fedopt_ctl_10 import FedOpt.
  3. Execute the code.
  4. Modify fed_ctl_10.py and commented out line 127 of the code.
  5. Execute the code again.

Expected behavior
get the error num_trainable_weights is not defined

Desktop (please complete the following information):

  • ubuntu 22.04
  • Python 3.9.16
  • NVFlare version is 2.5.1

Here are the custom code for fedopt and the logs before and after modification
fedopt_ctl_10.txt
fedopt_ctl_log_before_modification.txt
fedopt_ctl_log_after_modification.txt

@falibabaei falibabaei added the bug Something isn't working label Nov 11, 2024
@falibabaei falibabaei changed the title Changing custom script does not effect the run Custom Script Changes Not Reflected During Execution in NVFlare Nov 11, 2024
@yhwen yhwen self-assigned this Nov 15, 2024
@yhwen
Copy link
Collaborator

yhwen commented Nov 15, 2024

@falibabaei The root cause of this issue is because of the wrong indentation in your fedopt_ctl_10.py. The "def update_model(self, global_model: FLModel, aggr_result: FLModel):" has an extra indentation which makes this method unreachable. So your modified codes were not got executed.

@falibabaei
Copy link
Contributor Author

ah it happend during the copy. Sorry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants