p-christ / Deep-Reinforcement-Learning-Algorithms-with-PyTorch

PyTorch implementations of deep reinforcement learning algorithms and environments
MIT License
5.51k stars 1.19k forks source link

Actor output the wrong size in CartPole using PPO #42

Closed yaoxunji closed 4 years ago

yaoxunji commented 4 years ago

multiprocessing.pool.RemoteTraceback: """ Traceback (most recent call last): File "D:\Anaconda\lib\multiprocessing\pool.py", line 119, in worker result = (True, func(*args, *kwds)) File "D:\Anaconda\lib\multiprocessing\pool.py", line 44, in mapstar return list(map(args)) File "D:\papercode\RL\algorithm\Deep-Reinforcement-Learning-Algorithms-with-PyTorch-master\utilities\Parallel_Experience_Generator.py", line 41, in call return self.play_1_episode(exploration) File "D:\papercode\RL\algorithm\Deep-Reinforcement-Learning-Algorithms-with-PyTorch-master\utilities\Parallel_Experience_Generator.py", line 51, in play_1_episode action = self.pick_action(self.policy, state, epsilon_exploration) File "D:\papercode\RL\algorithm\Deep-Reinforcement-Learning-Algorithms-with-PyTorch-master\utilities\Parallel_Experience_Generator.py", line 79, in pick_action action_distribution = create_actor_distribution(self.action_types, actor_output, self.action_size) File "D:\papercode\RL\algorithm\Deep-Reinforcement-Learning-Algorithms-with-PyTorch-master\utilities\Utility_Functions.py", line 28, in create_actor_distribution assert actor_output.size()[1] == action_size * 2, "Actor output the wrong size" AssertionError: Actor output the wrong size

shuferhoo commented 4 years ago

take a try to change file "\Deep-Reinforcement-Learning-Algorithms-with-PyTorch-master\utilities\Parallel_Experience_Generator.py", line 19, self.action_types = "DISCRETE" if self.environment.action_space.dtype ==int else "CONTINUOUS" to self.action_types = "DISCRETE" if self.environment.action_space.dtype in [int, 'int64'] else "CONTINUOUS"