我正在尝试将Adam与var_list一起使用,但无法正常工作。
def get_name_trainable_variables(self):
var_names = []
for var in tf.trainable_variables():
var_names.append(var.name)
return var_names
/usr/local/lib/python3.5/dist-packages/tensorflow/python/training/optimizer.py in _get_processor(v)
200 # True if and only if `v` was initialized eagerly.
201 return _DenseResourceVariableProcessor(v)
--> 202 if v.op.type == "VarHandleOp":
203 return _DenseResourceVariableProcessor(v)
204 if isinstance(v, variables.Variable):
AttributeError: 'str' object has no attribute 'op'