in the below given code i am getting the follwoing error please rectify the error
WARNING:tensorflow:Gradients do not exist for variables ['actor_critic/dense_2/kernel:0', 'actor_critic/dense_2/bias:0'] when minimizing the loss. If you're using `model.compile()`, did you forget to provide a `loss` argument?
WARNING:tensorflow:Gradients do not exist for variables ['actor_critic/dense_2/kernel:0', 'actor_critic/dense_2/bias:0'] when minimizing the loss. If you're using `model.compile()`, did you forget to provide a `loss` argument?

# Define the neural network architecture for the actor and critic
class ActorCritic(tf.keras.Model):
    def __init__(self, n_actions):
        super(ActorCritic, self).__init__()
        self.dense1 = Dense(64, activation='relu')
        self.policy = Dense(n_actions, activation='softmax')
        self.value = Dense(1, activation=None)
        
    def call(self, state):
        x = self.dense1(state)
        policy = self.policy(x)
        value = self.value(x)
        return policy, value

# PPO Agent
class PPOAgent:
    def __init__(self, input_dims, alpha=0.0003, beta=0.0003, gamma=0.99, n_actions=13):
        self.actor_critic = ActorCritic(n_actions)
        self.actor_critic.compile(optimizer=Adam(learning_rate=alpha))
        self.gamma = gamma
        self.n_actions = n_actions
        self.action_space = np.arange(n_actions)
        
    def choose_action(self, input_observation):
        state = tf.convert_to_tensor([input_observation], dtype=tf.float32)
        probabilities, _ = self.actor_critic(state)
        action_probs = tfp.distributions.Categorical(probs=probabilities)
        action = action_probs.sample()
        return action.numpy()[0]
    
    def learn(self, state, action, reward, next_state, done):
        state = tf.convert_to_tensor([state], dtype=tf.float32)
        next_state = tf.convert_to_tensor([next_state], dtype=tf.float32)
        reward = tf.convert_to_tensor(reward, dtype=tf.float32)
        
        with tf.GradientTape(persistent=True) as tape:
            state_value, _ = self.actor_critic(state)
            next_state_value, _ = self.actor_critic(next_state)
            state_value = tf.squeeze(state_value)
            next_state_value = tf.squeeze(next_state_value)
            
            critic_loss = tf.math.square(reward + self.gamma * next_state_value * (1 - int(done)) - state_value)
            
            probabilities, _ = self.actor_critic(state)
            action_probs = tfp.distributions.Categorical(probs=probabilities)
            log_probs = action_probs.log_prob(action)
            
            ratios = tf.exp(log_probs - action_probs.entropy())
            actor_loss = -tf.math.minimum(ratios * reward, tf.clip_by_value(ratios, 1.0 - 0.2, 1.0 + 0.2) * reward)
            
            total_loss = critic_loss + actor_loss
        
        gradient_actor = tape.gradient(total_loss, self.actor_critic.trainable_variables)
        self.actor_critic.optimizer.apply_gradients(zip(gradient_actor, self.actor_critic.trainable_variables))

# Define the values for server_address, username, and password
server_address = 'xxxx'
username = 'xxxx'
password = 'xxxx'

# Initialize environment and agent
env = CustomEnvironment(server_address, username, password)

# Determine the value of 'n' for the 'input_dims'
n = len(bounds_low)

agent = PPOAgent(input_dims=n, n_actions=13)

# Training loop
n_episodes = 1000
for episode in range(n_episodes):
    done = False
    input_observation, perf_observation = env.reset()  # Get both states
    episode_reward = 0
    
    while not done:
        action = agent.choose_action(input_observation)
        next_input_observation, current_perf_observation, reward, done, _ = env.step(action)
        agent.learn(input_observation, action, reward, next_input_observation, done)
        episode_reward += reward
        input_observation = next_input_observation
    
    print(f"Episode: {episode + 1}, Reward: {episode_reward}")
    logging.info(f"Episode: {episode + 1}, Reward: {episode_reward}")
    
    if done:
        print("Mean reward reached 0. Training terminated.")
        break
    
env.close()