Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Applied Machine Learning
justus2-demo
Commits
5371251b
Commit
5371251b
authored
Jun 17, 2021
by
Patrick Michalsky
Browse files
changed cpu count function
parent
ad7c67f8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Docker/Image/code/main.py
View file @
5371251b
from
__future__
import
print_function
from
multiprocessing
import
cpu_count
import
tensorflow
as
tf
import
os
...
...
@@ -49,7 +48,7 @@ with open('./out/accuracy.txt', 'a+') as f:
f
.
write
(
'
\n
'
+
'Number of GPUs: '
+
str
(
gpu_count
)
+
'
\n
'
+
'Number of CPUs: '
+
str
(
cpu_count
(
))
+
'
\n
'
+
'Number of CPUs: '
+
str
(
len
(
list
(
os
.
sched_getaffinity
(
0
))
))
+
'
\n
'
+
str
(
'-'
*
32
)
+
'
\n
'
+
'Accuracy: '
+
str
(
"%.2f"
%
round
(
training_history
.
history
[
'accuracy'
][
-
1
]
*
100
,
2
))
+
'%
\n\n
'
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment