You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to implement the code in TF2.0 version and i received below error
opt/conda/lib/python3.6/site-packages/tensorflow_core/python/distribute/distribute_lib.py in _update(self, var, fn, args, kwargs, group)
2172 # The implementations of _update() and _update_non_slot() are identical
2173 # except _update() passes `var` as the first argument to `fn()`.
-> 2174 return self._update_non_slot(var, fn, (var,) + tuple(args), kwargs, group)
2175
2176 def _update_non_slot(self, colocate_with, fn, args, kwargs, should_group):
/opt/conda/lib/python3.6/site-packages/tensorflow_core/python/distribute/distribute_lib.py in _update_non_slot(self, colocate_with, fn, args, kwargs, should_group)
2178 # once that value is used for something.
2179 with UpdateContext(colocate_with):
-> 2180 result = fn(*args, **kwargs)
2181 if should_group:
2182 return result
/opt/conda/lib/python3.6/site-packages/tensorflow_core/python/keras/optimizer_v2/optimizer_v2.py in apply_grad_to_update_var(var, grad)
464 apply_kwargs["apply_state"] = apply_state
465 return self._resource_apply_sparse_duplicate_indices(
--> 466 grad.values, var, grad.indices, **apply_kwargs)
467
468 if "apply_state" in self._dense_apply_args:
/opt/conda/lib/python3.6/site-packages/tensorflow_core/python/keras/optimizer_v2/optimizer_v2.py in _resource_apply_sparse_duplicate_indices(self, grad, handle, indices, **kwargs)
901 values=grad, indices=indices)
902 return self._resource_apply_sparse(summed_grad, handle, unique_indices,
--> 903 **kwargs)
904
905 def _resource_apply_sparse(self, grad, handle, indices, apply_state):
<ipython-input-65-ccec5cd7a8c1> in _resource_apply_sparse(self, grad, var, indices, apply_state)
186 r_t,
187 lambda_ * var,
--> 188 use_locking=self._use_locking,
189 )
190 with ops.control_dependencies([r_t]):
/opt/conda/lib/python3.6/site-packages/tensorflow_core/python/ops/state_ops.py in assign_add(ref, value, use_locking, name)
193 return gen_state_ops.assign_add(
194 ref, value, use_locking=use_locking, name=name)
--> 195 return ref.assign_add(value)
196
197
AttributeError: 'Tensor' object has no attribute 'assign_add'
The text was updated successfully, but these errors were encountered:
I tried to implement the code in TF2.0 version and i received below error
The text was updated successfully, but these errors were encountered: