Skip to content

CohenKappa reset_states distributed training setup errors. #720

@n3011

Description

@n3011

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Google Colab
  • TensorFlow version and how it was installed (source or binary): 2.0.0
  • TensorFlow-Addons version and how it was installed (source or binary): 0.6.0
  • Python version: 3.6
  • Is GPU used? (yes/no): yes

Describe the bug
When using cohen kappa metric within the distribution strategy scope, reset_states throws the following errors:

 UFuncTypeError                            Traceback (most recent call last)
 <ipython-input-20-56dc62930e1d> in <module>()
 38     train_accuracy.reset_states()
 39     test_accuracy.reset_states()
  ---> 40     test_kappa.reset_states()

 2 frames
  /tensorflow-2.0.0/python3.6/tensorflow_core/python/distribute/values.py in assign(self, *args, 
   **kwargs)
 1218         tensor = args[0]
 1219         if self._aggregation == vs.VariableAggregation.SUM: 
     -> 1220           tensor *= 1. / len(self.devices)
 1221         return control_flow_ops.group(tuple(
  1222             _assign_on_device(v.device, v, tensor) for v in self._values))

 UFuncTypeError: Cannot cast ufunc 'multiply' output from dtype('float64') to dtype('int32') with 
      casting rule 'same_kind'

Code to reproduce the issue
Colab notebook
attached.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingmetrics

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions