renmengye / tensorflow-forward-ad

Forward-mode Automatic Differentiation for TensorFlow
MIT License
140 stars 18 forks source link

Error importing #6

Closed ssydasheng closed 6 years ago

ssydasheng commented 6 years ago
>>> import tensorflow_forward_ad
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/ssydasheng/workdir/project/tensorflow-forward-ad/tensorflow_forward_ad/__init__.py", line 1, in <module>
    from tensorflow_forward_ad.fwgrad import forward_gradients
  File "/Users/ssydasheng/workdir/project/tensorflow-forward-ad/tensorflow_forward_ad/fwgrad.py", line 40, in <module>
    from tensorflow_forward_ad import maxpool_gradgrad
  File "/Users/ssydasheng/workdir/project/tensorflow-forward-ad/tensorflow_forward_ad/maxpool_gradgrad.py", line 6, in <module>
    @ops.RegisterGradient("MaxPoolWithArgmax")
  File "/Users/ssydasheng/anaconda3/envs/cp3/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 2256, in __call__
    _gradient_registry.register(f, self._op_type)
  File "/Users/ssydasheng/anaconda3/envs/cp3/lib/python3.6/site-packages/tensorflow/python/framework/registry.py", line 62, in register
    (self._name, name, function_name, filename, line_number))
KeyError: "Registering two gradient with name 'MaxPoolWithArgmax' !(Previous registration was in _find_and_load_unlocked <frozen importlib._bootstrap>:955)"

Any idea on that?