ValueError: Cannot assign non-leaf Tensor to parameter 'weight'. Model parameters must be created explicitly. To express 'weight' as a function of another Tensor, compute the value in the forward() method. 加载权重成功了,infer报错 Activity ailongxia commented on May 3, 2024 ailongxia on May...
ValueError: can't optimize a non-leaf Tensor """ 检查: model.p.is_leaf # Truelist(model.p.is_leaf)# False list使is_leaf = False # 正确写法param=list(model.layers.parameters())param.append(model.p)
ValueError: (InvalidArgument) Leaf Tensor (auto_492_) that doesn't stop gradient can't use inplace strategy. [Hint: Expected self->IsLeaf() && !self->OverridedStopGradient() == false, but received self->IsLeaf() && !self->OverridedStopGradient():1 != false:0.] (at /paddle/paddle/...