Skip to content

RuntimeError: variable += value with tf.Variables is not supported. Use variable.assign_add(value) to modify the variable, or out = variable + value if you need to get a new output Tensor. #2

@qknoc455

Description

@qknoc455

在重現作者代碼時出現
File "style_transfer.py", line 125, in
loss += content_weight * content_loss(base_image_features,
File "C:\Users*\anaconda3\envs*\lib\site-packages\tensorflow\python\ops\resource_variable_ops.py", line 1561, in iadd
raise RuntimeError("variable += value with tf.Variables is not "
RuntimeError: variable += value with tf.Variables is not supported. Use variable.assign_add(value) to modify the variable, or out = variable + value if you need to get a new output Tensor.
但都沒有找到洽當的解決方法
請問有人遇到一樣得情況嗎?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions