[2, 4, 8, 16]
INFO:niftynet: reading size of preprocessed images
WARNING:niftynet: queue_length should be larger than batch_size, defaulting to batch_size * 5.0 (500).
INFO:niftynet: Initialising dataset from generator...
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
~/.local/lib/python3.6/site-packages/tensorflow/python/eager/execute.py in make_type(v, arg_name)
122 try:
--> 123 v = dtypes.as_dtype(v).base_dtype
124 except TypeError:
~/.local/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py in as_dtype(type_value)
670 try:
--> 671 return _INTERN_TABLE[type_value]
672 except KeyError:
TypeError: unhashable type: 'TensorShape'
During handling of the above exception, another exception occurred:
TypeError Traceback (most recent call last)
<ipython-input-4-3a863674afe1> in <module>()
15 batch_size=batch_size,
16 queue_length=num_parallel_call)
---> 17 next_window = sampler.pop_batch_op()
18 with tf.Session() as sess:
19 print('Num Parallel Calls: {}'.format(num_parallel_call))
~/phd/NiftyNet-Generator-PR/NiftyNet/niftynet/engine/image_window_dataset.py in pop_batch_op(self)
212 # in case `run_threads` is not called,
213 # here we initialise the dataset and iterator
--> 214 self.init_dataset()
215 self.iterator = self.dataset.make_one_shot_iterator()
216 # self.iterator = tf.data.Iterator.from_structure(
~/phd/NiftyNet-Generator-PR/NiftyNet/niftynet/engine/image_window_dataset.py in init_dataset(self)
233 dataset = self._dataset_from_range()
234 else:
--> 235 dataset = self._dataset_from_generator()
236 self.dataset = self.dataset_preprocessing(dataset)
237
~/phd/NiftyNet-Generator-PR/NiftyNet/niftynet/engine/image_window_dataset.py in _dataset_from_generator(self)
345 generator=window_generator,
346 output_types=self.tf_dtypes,
--> 347 output_shapes=element_shapes)
348 return dataset
349
~/.local/lib/python3.6/site-packages/tensorflow/python/data/ops/dataset_ops.py in from_generator(generator, output_types, output_shapes)
435 # versions of the returned dataset to be created, because it forces
436 # the generation of a new ID for each version.
--> 437 return id_dataset.flat_map(flat_map_fn)
438
439 @staticmethod
~/.local/lib/python3.6/site-packages/tensorflow/python/data/ops/dataset_ops.py in flat_map(self, map_func)
803 Dataset: A `Dataset`.
804 """
--> 805 return FlatMapDataset(self, map_func)
806
807 def interleave(self, map_func, cycle_length, block_length=1):
~/.local/lib/python3.6/site-packages/tensorflow/python/data/ops/dataset_ops.py in __init__(self, input_dataset, map_func)
1684
1685 self._map_func = tf_map_func
-> 1686 self._map_func.add_to_graph(ops.get_default_graph())
1687
1688 def _as_variant_tensor(self):
~/.local/lib/python3.6/site-packages/tensorflow/python/framework/function.py in add_to_graph(self, g)
484 def add_to_graph(self, g):
485 """Adds this function into the graph g."""
--> 486 self._create_definition_if_needed()
487
488 # Adds this function into 'g'.
~/.local/lib/python3.6/site-packages/tensorflow/python/framework/function.py in _create_definition_if_needed(self)
319 """Creates the function definition if it's not created yet."""
320 with context.graph_mode():
--> 321 self._create_definition_if_needed_impl()
322
323 def _create_definition_if_needed_impl(self):
~/.local/lib/python3.6/site-packages/tensorflow/python/framework/function.py in _create_definition_if_needed_impl(self)
336 # Call func and gather the output tensors.
337 with vs.variable_scope("", custom_getter=temp_graph.getvar):
--> 338 outputs = self._func(*inputs)
339
340 # There is no way of distinguishing between a function not returning
~/.local/lib/python3.6/site-packages/tensorflow/python/data/ops/dataset_ops.py in tf_map_func(*args)
1672 dataset = map_func(*nested_args)
1673 else:
-> 1674 dataset = map_func(nested_args)
1675
1676 if not isinstance(dataset, Dataset):
~/.local/lib/python3.6/site-packages/tensorflow/python/data/ops/dataset_ops.py in flat_map_fn(iterator_id_t)
419 # relevant ID, and raises StopIteration when that iterator contains no
420 # more elements.
--> 421 return repeated_id.map(generator_map_fn)
422
423 # A single-element dataset that, each time it is evaluated, contains a
~/.local/lib/python3.6/site-packages/tensorflow/python/data/ops/dataset_ops.py in map(self, map_func, num_parallel_calls)
788 """
789 if num_parallel_calls is None:
--> 790 return MapDataset(self, map_func)
791 else:
792 return ParallelMapDataset(self, map_func, num_parallel_calls)
~/.local/lib/python3.6/site-packages/tensorflow/python/data/ops/dataset_ops.py in __init__(self, input_dataset, map_func)
1595
1596 self._map_func = tf_map_func
-> 1597 self._map_func.add_to_graph(ops.get_default_graph())
1598
1599 def _as_variant_tensor(self):
~/.local/lib/python3.6/site-packages/tensorflow/python/framework/function.py in add_to_graph(self, g)
484 def add_to_graph(self, g):
485 """Adds this function into the graph g."""
--> 486 self._create_definition_if_needed()
487
488 # Adds this function into 'g'.
~/.local/lib/python3.6/site-packages/tensorflow/python/framework/function.py in _create_definition_if_needed(self)
319 """Creates the function definition if it's not created yet."""
320 with context.graph_mode():
--> 321 self._create_definition_if_needed_impl()
322
323 def _create_definition_if_needed_impl(self):
~/.local/lib/python3.6/site-packages/tensorflow/python/framework/function.py in _create_definition_if_needed_impl(self)
336 # Call func and gather the output tensors.
337 with vs.variable_scope("", custom_getter=temp_graph.getvar):
--> 338 outputs = self._func(*inputs)
339
340 # There is no way of distinguishing between a function not returning
~/.local/lib/python3.6/site-packages/tensorflow/python/data/ops/dataset_ops.py in tf_map_func(*args)
1560 ret = map_func(*nested_args)
1561 else:
-> 1562 ret = map_func(nested_args)
1563
1564 # If `map_func` returns a list of tensors, `nest.flatten()` and
~/.local/lib/python3.6/site-packages/tensorflow/python/data/ops/dataset_ops.py in generator_map_fn(iterator_id_t)
399
400 flat_values = script_ops.py_func(
--> 401 generator_py_func, [iterator_id_t], flattened_types, stateful=True)
402
403 # The `py_func()` op drops the inferred shapes, so we add them back in
~/.local/lib/python3.6/site-packages/tensorflow/python/ops/script_ops.py in py_func(func, inp, Tout, stateful, name)
315 """
316 return _internal_py_func(
--> 317 func=func, inp=inp, Tout=Tout, stateful=stateful, eager=False, name=name)
318
319
~/.local/lib/python3.6/site-packages/tensorflow/python/ops/script_ops.py in _internal_py_func(func, inp, Tout, stateful, eager, name)
223 if stateful:
224 result = gen_script_ops._py_func(
--> 225 input=inp, token=token, Tout=Tout, name=name)
226 else:
227 result = gen_script_ops._py_func_stateless(
~/.local/lib/python3.6/site-packages/tensorflow/python/ops/gen_script_ops.py in _py_func(input, token, Tout, name)
87 "Expected list for 'Tout' argument to "
88 "'py_func' Op, not %r." % Tout)
---> 89 Tout = [_execute.make_type(_t, "Tout") for _t in Tout]
90 _ctx = _context.context()
91 if _ctx.in_graph_mode():
~/.local/lib/python3.6/site-packages/tensorflow/python/ops/gen_script_ops.py in <listcomp>(.0)
87 "Expected list for 'Tout' argument to "
88 "'py_func' Op, not %r." % Tout)
---> 89 Tout = [_execute.make_type(_t, "Tout") for _t in Tout]
90 _ctx = _context.context()
91 if _ctx.in_graph_mode():
~/.local/lib/python3.6/site-packages/tensorflow/python/eager/execute.py in make_type(v, arg_name)
124 except TypeError:
125 raise TypeError("Expected DataType for argument '%s' not %s." %
--> 126 (arg_name, repr(v)))
127 i = v.as_datatype_enum
128 return i
TypeError: Expected DataType for argument 'Tout' not TensorShape([Dimension(1), Dimension(100), Dimension(100), Dimension(100), Dimension(1), Dimension(1)]).