Tensorflow 2 ValueError: Shapes (20, 1) and (20, 2) are incompatible in gym environment
问题 Just for learning I wanted to test this code. But there is a problem in it. I do not understand the problem. It says: ValueError: Shapes (20, 1) and (20, 2) are incompatible from the line loss = network.train_on_batch(states, discounted_rewards) Maybe there is something new in Tensorflow that was not there, the it was implemented. The code from the website: https://adventuresinmachinelearning.com/policy-gradient-tensorflow-2/ import gym import tensorflow as tf from tensorflow import keras