parl版本2.1
paddle版本2.4.2
conv1 = Conv2D(num_channels=1, num_filters=20, filter_size=5, stride=1, padding=2, act='relu')
obs = parl.core.fluid.layers.data(name='obs', shape=[None, self.obs_dim], dtype='float32')
def value(self, obs):
x = self.conv1(obs)
如此使用时会有以下报错:
TypeError: The type of 'Filter' in operator conv2d should be one of [basestring(), str, Varibale] in python2, or one of [str, bytes, Variable] in python3.but received : Parameter containing:
Tensor(shape=[20, 1, 5, 5], dtype=float32, place=Place(cpu), stop_gradient=False,
[[[[ 0.47243306, -0.20335183, -0.09854988, -0.01032914, 0.08503843],
[ 0.15641759, 0.17344509, -0.03785811, -0.42239943, 0.27567264],
[ 0.35463092, -0.11124908, 0.28107727, 0.13953362, 0.66362083],
[-0.07623158, 0.27313450, 0.09171128, -0.16410473, -0.02793298],
[-0.39371279, 0.60560465, 0.08527652, -0.12554359, -0.39569846]]],……