Closed Zhiyuan-w closed 3 years ago
It may cause a SyntaxError: non-default argument follows default argument. As I do:
gpu: str=None in train, predict
Could I keep the "--gpu" as required and add a "--remote" arg? Like
"--remote", "-r", help="Use GPU remotely for training.", dest="remote", action="store_true", required=False, default=False
In train()
train(....., remote:bool = False) if not remote: os.environ["CUDA_VISIBLE_DEVICES"] = gpu os.environ["TF_FORCE_GPU_ALLOW_GROWTH"] = "true" if gpu_allow_growth else "false"
My wifi is not stable right now. Sorry for sending comments twice.
@Zhiyuan-w Hi, lets not add more arguments to CLI if not absolutely necessary. I still think we can configure via gpu argument. Let me have a think
@Zhiyuan-w ok so instead of making gpu:str = None in the functions, just make the default arg in GPU CLI None or False. That way, the same logic applies but we don't need to change the order of the args or add remote to the CLI. So simply passing "GPU" arg to CLI will trigger CUDA_VISIBLE_DEVICES, if it is not passed it will be put in as "False". Does that make sense?
Good idea. I will push the new commit today.
Merging #792 (e31cf5a) into main (35be9fa) will not change coverage. The diff coverage is
100.00%
.
@@ Coverage Diff @@
## main #792 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 41 41
Lines 2501 2503 +2
=========================================
+ Hits 2501 2503 +2
Impacted Files | Coverage Δ | |
---|---|---|
deepreg/predict.py | 100.00% <100.00%> (ø) |
|
deepreg/train.py | 100.00% <100.00%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 35be9fa...e31cf5a. Read the comment docs.
Changelog needs to be updated before merge.
@mathpluscode @YipengHu can you review please?
@Zhiyuan-w Can you merge main into branch so that it is up to date?
@Zhiyuan-w Can you merge main into branch so that it is up to date?
BUMP @Zhiyuan-w
Thanks for your contribution! @Zhiyuan-w , also @alkististav, check the fix!
Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Fixes #
Type of change
What types of changes does your code introduce to DeepReg?
Please check the boxes that apply after submitting the pull request.
Checklist
Please check the boxes that apply after submitting the pull request.
If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.
pre-commit install
and formatted all changed files. If you are not certain, runpre-commit run --all-files
.Issue #<issue number>: detailed message
.