TsingZ0 / PFLlib

We expose this user-friendly algorithm library (with an integrated evaluation platform) for beginners who intend to start federated learning (FL) study
GNU General Public License v2.0
1.3k stars 275 forks source link

Nohup run #195

Closed gestefane closed 2 weeks ago

gestefane commented 3 weeks ago

Hi! How to run with nohup and log to a file? I want to log all scripts output results including time cost for each round. It appears that this information is not logged on MNIST_FedAvg_test_0.h5 file, for example.

I just tried using: nohup python main.py -data MNIST -m cnn -algo FedAvg -gr 2000 -did 0 & and the tule nohup.out always contains only one line with "ignoring input"

I tried using: nohup python main.py -data MNIST -m cnn -algo FedAvg -gr 2000 -did 0 > nohup-test.out 2>&1 &

with same result for nohup-test.out file.

Thank you.

TsingZ0 commented 3 weeks ago

You need to add -u after python, e.g., nohup python -u main.py ..., to directly print results to the file without using the buffer. Please see the run_me.sh files in FedALA, FedCP, GPFL, and DBE for examples.