I have a google Colab notebook inspired from https://github.com/kyzhouhzau/BERT-NER that worked perfectly fine a couple of months ago.
Now it fails during training at the line
estimator.train(input_fn=train_input_fn, max_steps=num_train_steps)
With the error message:
TypeError Traceback (most recent call last)
<ipython-input-106-a57b458e486b> in <module>()
54 is_training=True,
55 drop_remainder=True)
---> 56 estimator.train(input_fn=train_input_fn, max_steps=num_train_steps)
57
58 #evaluate
14 frames
/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/ops.py in __iter__(self)
475 if not context.executing_eagerly():
476 raise TypeError(
--> 477 "Tensor objects are only iterable when eager execution is "
478 "enabled. To iterate over this tensor use tf.map_fn.")
479 shape = self._shape_tuple()
TypeError: Tensor objects are only iterable when eager execution is enabled. To iterate over this tensor use tf.map_fn.
I tried adding: tf.enable_eager_execution()
to force eager execution but it did not help
I'm thinking an update on libraries may be causing the issue. It used to work on tensorflow 1.13.1 and bert-tensorflow-1.0.1 (from bert-tensorflow) (1.11.0).
Now it's using tensorflow 1.14.0-rc1 and bert-tensorflow-1.0.1 (from bert-tensorflow) (1.12.0).
Any advice on how to address this would be greatly appreciated! Thanks