
Which means, from_generator should not change the types of any arguments given via the args parameter. The example should work without exception. ] Īs it turns out this is because the window_size given in the args argument is unexpectedly converted from int to np.int32, which can't be used interchangeably for slicing or the deque maxlen parameter. Values = next(generator_state.get_iterator(iterator_id))īuffer = que( data, maxlen = window_size ) InvalidArgumentError: TypeError: an integer is requiredįile "/home/maximiliank/.local/lib/python3.6/site-packages/tensorflow_core/python/ops/script_ops.py", line 221, in _call_įile "/home/maximiliank/.local/lib/python3.6/site-packages/tensorflow_core/python/data/ops/dataset_ops.py", line 585, in generator_py_func usr/lib/python3/dist-packages/six.py in raise_from(value, from_value)

> 2673 _six.raise_from(_core._status_to_exception(e.code, message), None)Ģ674 # Add nodes to the TensorFlow graph.Ģ675 if not isinstance(output_types, (list, tuple)): home/maximiliank/.local/lib/python3.6/site-packages/tensorflow_core/python/ops/gen_dataset_ops.py in iterator_get_next_sync(iterator, output_types, output_shapes, name) > 651 output_shapes=self._flat_output_shapes) home/maximiliank/.local/lib/python3.6/site-packages/tensorflow_core/python/data/ops/iterator_ops.py in _next_internal(self)Ħ50 output_types=self._flat_output_types, In this article, I cover the implementation of tf.data.Dataset class on top of keras’ ImageDataGenerator for creating a data pipeline for image pairs.Few Example tasks with this requirement are. home/maximiliank/.local/lib/python3.6/site-packages/tensorflow_core/python/data/ops/iterator_ops.py in next(self)Ħ64 """Returns a nested structure of `Tensor`s containing the next element.""" home/maximiliank/.local/lib/python3.6/site-packages/tensorflow_core/python/data/ops/iterator_ops.py in _next_(self)Ħ21 def _next_(self): # For Python 3 compatibility InvalidArgumentError Traceback (most recent call last)ġ8 print( next( movingWindow( data, window_size ) ) )
