File size: 615 Bytes
d2af664
 
 
 
 
 
019caa7
d2af664
 
 
 
 
17d54f7
d2af664
 
 
 
 
409b653
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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()