philtabor / Youtube-Code-Repository

Repository for most of the code from my YouTube channel
873 stars 479 forks source link

Fix to solution: TypeErrorr in actor_critic tensorflow2 main.py #37

Closed simoneliasen closed 2 years ago

simoneliasen commented 3 years ago

In the following document: Youtube-Code-Repository/ReinforcementLearning/PolicyGradient/actor_critic/tensorflow2/main.py

Running the program returns: File "actorcritic.py", line 157, in agent.learn(observation, action, reward, observation, done) TypeError: learn() takes 5 positional arguments but 6 were given

I think this could be fixed by changing the following line: agent.learn(observation, action, reward, observation_, done)

to: agent.learn(observation, reward, observation_, done)

Sorry for the suggestion format, first time suggesting fixes :D

philtabor commented 2 years ago

Yes, this is correct. I fixed this in a recent commit. Thanks!