Could not compute ANN values on this machine: in user code:
/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/tensorflow/python/keras/engine/training.py:1224 test_function *
return step_function(self, iterator)
/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/tensorflow/python/keras/engine/training.py:1215 step_function **
outputs = model.distribute_strategy.run(run_step, args=(data,))
/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/tensorflow/python/distribute/distribute_lib.py:1211 run
return self._extended.call_for_each_replica(fn, args=args, kwargs=kwargs)
/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/tensorflow/python/distribute/distribute_lib.py:2585 call_for_each_replica
return self._call_for_each_replica(fn, args, kwargs)
/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/tensorflow/python/distribute/distribute_lib.py:2945 _call_for_each_replica
return fn(*args, **kwargs)
/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/tensorflow/python/keras/engine/training.py:1208 run_step **
outputs = model.test_step(data)
/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/tensorflow/python/keras/engine/training.py:1177 test_step
y, y_pred, sample_weight, regularization_losses=self.losses)
/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/tensorflow/python/keras/engine/compile_utils.py:187 __call__
self.build(y_pred)
/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/tensorflow/python/keras/engine/compile_utils.py:140 build
self._losses = nest.map_structure(self._get_loss_object, self._losses)
/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/tensorflow/python/util/nest.py:635 map_structure
structure[0], [func(*x) for x in entries],
/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/tensorflow/python/util/nest.py:635 <listcomp>
structure[0], [func(*x) for x in entries],
/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/tensorflow/python/keras/engine/compile_utils.py:265 _get_loss_object
loss_name = loss.__name__
AttributeError: 'functools.partial' object has no attribute '__name__'
This issue was introduced in TF 2.2.0, and has been replicated in Python 3.6+. While it doesn't cause an issue for the docs build (because it uses pre-trained weights), this error will prevent users from training the model themselves.
This issue can be resolved by returning the exact function instance (instead of using partial), or by using a lambda function (but one of the code style checkers / formatters will complain).
To replicate this error:
The error:
The error is visible in the online docs, cell 8:
This issue was introduced in TF 2.2.0, and has been replicated in Python 3.6+. While it doesn't cause an issue for the docs build (because it uses pre-trained weights), this error will prevent users from training the model themselves.
This issue can be resolved by returning the exact function instance (instead of using
partial
), or by using a lambda function (but one of the code style checkers / formatters will complain).