Violeta Menéndez González
[email protected]
Keeping track of changes with commits
●Every change is a commit with:
○A unique identifier
○A date
○An author
○A clear and concise message
○A set of changes to the code (diff)
●Good messages for good history:
○Short description in imperative
○Blank line
○Long description
●Commit ID: SHA1
○Hash: means it’s unique!
○It encodes history
commit 2bedc34e012778ca0abb70c14e9e40d13a81f53e
Author: Violeta Menendez Gonzalez <
[email protected]>
Date: Wed May 25 15:54:31 2022 +0100
Check if cuda available before using
diff --git a/train.py b/train.py
index bc31650..10ebd4f 100644
--- a/train.py
+++ b/train.py
@@ -572,4 +572,5 @@ if __name__ == '__main__':
try:
main()
finally:
- print(torch.cuda.memory_summary(abbreviated=True))
+ if torch.cuda.is_available():
+ print(torch.cuda.memory_summary(abbreviated=True))