peterding / lamb Goto Github PK
View Code? Open in Web Editor NEWAn Implementation for the optimizer LAMB with Tensorflow 2.0
An Implementation for the optimizer LAMB with Tensorflow 2.0
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'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.