SforAiDl / genrl

A PyTorch reinforcement learning library for generalizable and reproducible algorithm implementations with an aim to improve accessibility in RL
https://genrl.readthedocs.io
MIT License
404 stars 59 forks source link

Importing A2C fails #349

Closed bscoventry closed 3 years ago

bscoventry commented 3 years ago

Hi,

When trying out different algorithms, I run into an import error for A2C. Code is from Advantage actor critic sample in the wiki:

import gym

from genrl import A2C
from genrl.deep.common import OnPolicyTrainer
from genrl.environments import VectorEnv

env = VectorEnv("CartPole-v0")
agent = A2C('mlp', env)
trainer = OnPolicyTrainer(agent, env, log_mode=['stdout'])
trainer.train()

and fails with ImportError: cannot import name 'A2C'

Setup is Python 3.6.8, Cuda 10.1

hades-rp2010 commented 3 years ago

Could you try from genrl.agents import A2C instead? That might fix it for now.