优化函数加正则报错
Created by: AWSWXY
优化函数加正则报错 File "</home/disk6/xinyu/.jumbo/lib/python2.7/site-packages/decorator.pyc:decorator-gen-20>", line 2, in minimize File "/home/disk6/xinyu/.jumbo/lib/python2.7/site-packages/paddle/fluid/wrapped_decorator.py", line 25, in impl return wrapped_func(*args, **kwargs) File "/home/disk6/xinyu/.jumbo/lib/python2.7/site-packages/paddle/fluid/dygraph/base.py", line 88, in impl return func(*args, **kwargs) File "/home/disk6/xinyu/.jumbo/lib/python2.7/site-packages/paddle/fluid/optimizer.py", line 600, in minimize loss, startup_program=startup_program, params_grads=params_grads) File "/home/disk6/xinyu/.jumbo/lib/python2.7/site-packages/paddle/fluid/optimizer.py", line 561, in apply_optimize optimize_ops = self.apply_gradients(params_grads) File "/home/disk6/xinyu/.jumbo/lib/python2.7/site-packages/paddle/fluid/optimizer.py", line 529, in apply_gradients self.regularization) File "/home/disk6/xinyu/.jumbo/lib/python2.7/site-packages/paddle/fluid/regularizer.py", line 57, in append_regularization_ops regularization_term = regularization(param, grad, grad.block) File "/home/disk6/xinyu/.jumbo/lib/python2.7/site-packages/paddle/fluid/regularizer.py", line 169, in call dtype=param.dtype, shape=param.shape, lod_level=param.lod_level) File "/home/disk6/xinyu/.jumbo/lib/python2.7/site-packages/paddle/fluid/framework.py", line 1600, in create_var var = Variable(block=self, *args, **kwargs) File "/home/disk6/xinyu/.jumbo/lib/python2.7/site-packages/paddle/fluid/framework.py", line 469, in init "matched.".format(self.name, old_shape, shape)) ValueError: Variable _generated_var_0 has been created before. the previous shape is (1L, 4096L); the new shape is (256L,). They are not matched.
优化函数加decay报错 File "</home/disk6/xinyu/.jumbo/lib/python2.7/site-packages/decorator.pyc:decorator-gen-20>", line 2, in minimize File "/home/disk6/xinyu/.jumbo/lib/python2.7/site-packages/paddle/fluid/wrapped_decorator.py", line 25, in impl return wrapped_func(*args, **kwargs) File "/home/disk6/xinyu/.jumbo/lib/python2.7/site-packages/paddle/fluid/dygraph/base.py", line 88, in impl return func(*args, **kwargs) File "/home/disk6/xinyu/.jumbo/lib/python2.7/site-packages/paddle/fluid/optimizer.py", line 600, in minimize loss, startup_program=startup_program, params_grads=params_grads) File "/home/disk6/xinyu/.jumbo/lib/python2.7/site-packages/paddle/fluid/optimizer.py", line 561, in apply_optimize optimize_ops = self.apply_gradients(params_grads) File "/home/disk6/xinyu/.jumbo/lib/python2.7/site-packages/paddle/fluid/optimizer.py", line 531, in apply_gradients optimize_ops = self._create_optimization_pass(params_grads) File "/home/disk6/xinyu/.jumbo/lib/python2.7/site-packages/paddle/fluid/optimizer.py", line 365, in _create_optimization_pass self._create_global_learning_rate() File "/home/disk6/xinyu/.jumbo/lib/python2.7/site-packages/paddle/fluid/optimizer.py", line 215, in _create_global_learning_rate "learning rate variable is create outside optimizer," TypeError: learning rate variable is create outside optimizer,can not create new learning rate variable for new program