【论文复现】RuntimeError: parallel_for failed: invalid configuration argument
Created by: zbp-xxxp
---------------------------------------------------------------------------RuntimeError Traceback (most recent call last) in 1 # 测试生成网络G和判别网络D 2 with fluid.dygraph.guard(): ----> 3 g_tmp = G('G') 4 tmp_g = g_tmp(fluid.dygraph.to_variable(np.array(z_tmp))).numpy() 5 print('生成器G生成图片数据的形状:', tmp_g.shape) in init(self, name_scope) 5 super(G, self).init(name_scope) 6 name_scope = self.full_name ----> 7 self.fc1 = Linear(input_dim=100, output_dim=1024) 8 self.bn1 = fluid.dygraph.BatchNorm(num_channels=1024, act='tanh') 9 self.fc2 = Linear(input_dim=1024, output_dim=12877) /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/nn.py in init(self, input_dim, output_dim, param_attr, bias_attr, act, dtype) 933 attr=param_attr, 934 dtype=dtype, --> 935 is_bias=False) 936 self.bias = self.create_parameter( 937 shape=[output_dim], attr=bias_attr, dtype=dtype, is_bias=True) /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py in create_parameter(self, shape, attr, dtype, is_bias, default_initializer) 260 temp_attr = None 261 return self._helper.create_parameter(temp_attr, shape, dtype, is_bias, --> 262 default_initializer) 263 264 # TODO: Add more parameter list when we need them /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/layer_helper_base.py in create_parameter(self, attr, shape, dtype, is_bias, default_initializer, stop_gradient, type) 345 type=type, 346 stop_gradient=stop_gradient, --> 347 **attr._to_kwargs(with_initializer=True)) 348 else: 349 self.startup_program.global_block().create_parameter( /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/framework.py in create_parameter(self, *args, **kwargs) 2568 pass 2569 else: -> 2570 initializer(param, self) 2571 param.stop_gradient = False 2572 return param /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/initializer.py in call(self, var, block) 540 "seed": self._seed 541 }, --> 542 stop_gradient=True) 543 544 else: /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/framework.py in _prepend_op(self, *args, **kwargs) 2668 kwargs.get("outputs", {}), attrs 2669 if attrs else {}, -> 2670 kwargs.get("stop_gradient", False)) 2671 else: 2672 op_desc = self.desc._prepend_op() /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/tracer.py in trace_op(self, type, inputs, outputs, attrs, stop_gradient) 41 self.trace(type, inputs, outputs, attrs, 42 framework._current_expected_place(), self._train_mode and ---> 43 not stop_gradient) 44 45 def train_mode(self): RuntimeError: parallel_for failed: invalid configuration argument