Update app.py
Browse files
app.py
CHANGED
@@ -28,3 +28,26 @@ if gpus:
|
|
28 |
# TensorFlow ๋ฐ ์์คํ
์ ๋ณด ํ์ธ
|
29 |
print("TensorFlow ๋ฒ์ :", tf.__version__)
|
30 |
print("์ฌ์ฉ ๊ฐ๋ฅํ ์ฅ์น:", tf.config.list_physical_devices())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
# TensorFlow ๋ฐ ์์คํ
์ ๋ณด ํ์ธ
|
29 |
print("TensorFlow ๋ฒ์ :", tf.__version__)
|
30 |
print("์ฌ์ฉ ๊ฐ๋ฅํ ์ฅ์น:", tf.config.list_physical_devices())
|
31 |
+
|
32 |
+
import os
|
33 |
+
import tensorflow as tf
|
34 |
+
|
35 |
+
# oneDNN ์ต์ ํ ๋นํ์ฑํ
|
36 |
+
os.environ['TF_ENABLE_ONEDNN_OPTS'] = '0'
|
37 |
+
|
38 |
+
# GPU ๋นํ์ฑํ (CUDA ๋ฌธ์ ํด๊ฒฐ ์)
|
39 |
+
os.environ["CUDA_VISIBLE_DEVICES"] = "-1"
|
40 |
+
|
41 |
+
# TensorFlow GPU ๋ฉ๋ชจ๋ฆฌ ์ค์
|
42 |
+
gpus = tf.config.experimental.list_physical_devices('GPU')
|
43 |
+
if gpus:
|
44 |
+
try:
|
45 |
+
for gpu in gpus:
|
46 |
+
tf.config.experimental.set_memory_growth(gpu, True)
|
47 |
+
print("GPU ๋ฉ๋ชจ๋ฆฌ ์ฆ๊ฐ ํ์ฉ ์ค์ ์๋ฃ")
|
48 |
+
except RuntimeError as e:
|
49 |
+
print(f"GPU ์ค์ ์ค๋ฅ: {e}")
|
50 |
+
|
51 |
+
# TensorFlow ์คํ ํ์ธ
|
52 |
+
print("TensorFlow ๋ฒ์ :", tf.__version__)
|
53 |
+
print("์ฌ์ฉ ๊ฐ๋ฅํ ์ฅ์น:", tf.config.list_physical_devices())
|