Submitted by ContributionFun3037 t3_108bbsj in deeplearning

I'm new to deep learning, and I'm currently trying to wrap my head over Reinforcement learning by using open ai gym(to train agents i.e).

import gymnasium as gym
from stable_baselines3 import PPO
from stable_baselines3.common.vec_env import dummy_vec_env
from stable_baselines3.common.evaluation import evaluate_policy
from stable_baselines3.ppo import MlpPolicy
import os

log_path=os.path.join('Training', 'Logs')

env = gym.make("CartPole-v1", render_mode="human")
env= dummy_vec_env([lambda:env])
model= PPO(MlpPolicy, env, verbose=1, tensorboard_log=log_path)

I can see the cartpole window and after exiting I'm getting this error and I don't know why.

env= dummy_vec_env([lambda:env])
TypeError: 'module' object is not callable

The tutorial I'm following is almost 2 years old and I suspect there have been plenty of changes to many pip packages- which I'm now trying to install and run (as shown in the tutorial). Can you pls tell me what I'm doing wrong and also pls source me any good(and updated) beginner reinforcement learning tutorial(if they are available).

0

Comments

You must log in or register to comment.

Balocre t1_j3rlblk wrote

That s not a DL problem, you should review your python basics

5

lohvei0r t1_j3rq4gi wrote

You should give actionable feedback or STFU

−5

Balocre t1_j3rt4xt wrote

No, because this is a lazy person that could not be bothered trying to look for the answer on the internet first You on the other hand should be more polite

6

ContributionFun3037 OP t1_j3tve9t wrote

I looked online for hours and found no Sol. I came here as last resort.(i also had some box2d errors which I looked up online and solved after hours but this I couldn't find anything about). Since the tutorial uses old package versions i thought the problem was with that.
I found a new updated tutorial by huggingface- hopefully I won't end up with the same error again. Thanks either way!

1