lfwa / carbontracker

Track and predict the energy consumption and carbon footprint of training deep learning models.
MIT License
374 stars 27 forks source link

CLI tool assumes the user script is Python #60

Closed lnicola closed 1 year ago

lnicola commented 1 year ago

There's nothing specific to Python in the implementation, so it could work for any kind of program, but the implementation assumes Python. Simply replacing https://github.com/lfwa/carbontracker/blob/master/carbontracker/cli.py#L23 with subprocess.run([args.script], check=True) would fix this (with the caveat that the script needs to be marked as executable and start with e.g. #!/usr/bin/env python).

PedramBakh commented 1 year ago

Thanks for bringing this to our attention. We've addressed your points in patch v1.2.1. You can now use the tool with arbitrary commands, like: carbontracker myscript arg1 arg2 --log_dir ./logs.