tinyvision / PreNAS

The official implementation of paper PreNAS: Preferred One-Shot Learning Towards Efficient Neural Architecture Search
Apache License 2.0
21 stars 6 forks source link

force argument in print function #5

Open iksooman opened 10 months ago

iksooman commented 10 months ago

Thanks for sharing your code!

I'm trying to test your code, but I got an error like:

Traceback (most recent call last):
  File "C:\Users\admin\PreNAS\supernet_train.py", line 463, in <module>
    main(args)
  File "C:\Users\admin\PreNAS\supernet_train.py", line 404, in main
    train_stats = train_one_epoch(
  File "C:\Users\admin\PreNAS\supernet_engine.py", line 187, in train_one_epoch
    print("DEBUG:train {}".format(config), force=print2file)
TypeError: 'force' is an invalid keyword argument for print()

Could you give me an idea for resolving this error?

drcege commented 3 months ago

Did you skip the distributed setup? The print function is replaced here: https://github.com/tinyvision/PreNAS/blob/0050c7a22482e8736f148bc41ab0d952968a8748/lib/utils.py#L165-L177