()
| 40 | |
| 41 | @contextmanager |
| 42 | def _inference_context(): |
| 43 | msg = "You might need to check your input implementation." |
| 44 | try: |
| 45 | yield |
| 46 | except (StopIteration, tf.errors.CancelledError): |
| 47 | logger.error( |
| 48 | "[InferenceRunner] input stopped before reaching its __len__()! " + msg) |
| 49 | raise |
| 50 | except tf.errors.OutOfRangeError: # tf.data reaches an end |
| 51 | pass |
| 52 | |
| 53 | |
| 54 | class InferenceRunnerBase(Callback): |