|
|
import tensorflow as tf |
|
|
print("Num GPUs Available: ", len(tf.config.list_physical_devices('GPU'))) |
|
|
|
|
|
gpus = tf.config.list_physical_devices('GPU') |
|
|
if gpus: |
|
|
try: |
|
|
|
|
|
for gpu in gpus: |
|
|
tf.config.experimental.set_memory_growth(gpu, True) |
|
|
logical_gpus = tf.config.experimental.list_logical_devices('GPU') |
|
|
print(len(gpus), "Physical GPUs,", len(logical_gpus), "Logical GPUs") |
|
|
except RuntimeError as e: |
|
|
|
|
|
print(e) |
|
|
|
|
|
import gymnasium as gym |
|
|
env = gym.make("CarRacing-v3", render_mode="rgb_array") |
|
|
print("CarRacing-v3 environment created successfully.") |
|
|
env.close() |