File size: 611 Bytes
ef73561
 
 
 
 
 
c6755e1
ef73561
 
 
 
 
 
 
 
 
 
 
f0c8b65
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()