Code Monkey home page Code Monkey logo

lamb's People

Contributors

peterding avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

lamb's Issues

AttributeError: 'Tensor' object has no attribute 'assign_add'

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'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.