HasnainRaz/FC-DenseNet-TensorFlow

how to solve this error

summerrr opened this issue · 1 comments

python main.py --mode=train
Traceback (most recent call last):
File "/home/user10/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 510, in _apply_op_helper
preferred_dtype=default_dtype)
File "/home/user10/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1094, in internal_convert_to_tensor
ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
File "/home/user10/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 931, in _TensorTensorConversionFunction
(dtype.name, t.dtype.name, str(t)))

ValueError: Tensor conversion requested dtype string for Tensor with dtype float32: 'Tensor("arg0:0", shape=(), dtype=float32)'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "main.py", line 44, in
main()
File "main.py", line 38, in main
FLAGS.batch_size, FLAGS.epochs, FLAGS.learning_rate)
File "/home/user10/notebook/tiramisu/model.py", line 281, in train
train_image_paths, train_mask_paths, batch_size)
File "/home/user10/notebook/tiramisu/utility.py", line 86, in data_batch
num_parallel_calls=num_threads).prefetch(30)
File "/home/user10/anaconda3/lib/python3.6/site-packages/tensorflow/python/data/ops/dataset_ops.py", line 988, in map
return ParallelMapDataset(self, map_func, num_parallel_calls)
File "/home/user10/anaconda3/lib/python3.6/site-packages/tensorflow/python/data/ops/dataset_ops.py", line 2230, in init
super(ParallelMapDataset, self).init(input_dataset, map_func)
File "/home/user10/anaconda3/lib/python3.6/site-packages/tensorflow/python/data/ops/dataset_ops.py", line 2198, in init
map_func, "Dataset.map()", input_dataset)
File "/home/user10/anaconda3/lib/python3.6/site-packages/tensorflow/python/data/ops/dataset_ops.py", line 1454, in init
self._function.add_to_graph(ops.get_default_graph())
File "/home/user10/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/function.py", line 481, in add_to_graph
self._create_definition_if_needed()
File "/home/user10/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/function.py", line 337, in _create_definition_if_needed
self._create_definition_if_needed_impl()
File "/home/user10/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/function.py", line 346, in _create_definition_if_needed_impl
self._capture_by_value, self._caller_device)
File "/home/user10/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/function.py", line 863, in func_graph_from_py_func
outputs = func(*func_graph.inputs)
File "/home/user10/anaconda3/lib/python3.6/site-packages/tensorflow/python/data/ops/dataset_ops.py", line 1392, in tf_data_structured_function_wrapper
ret = func(*nested_args)
File "/home/user10/notebook/tiramisu/utility.py", line 5, in _parse_data_infer
image_content = tf.read_file(image_paths)
File "/home/user10/anaconda3/lib/python3.6/site-packages/tensorflow/python/ops/gen_io_ops.py", line 528, in read_file
"ReadFile", filename=filename, name=name)
File "/home/user10/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 533, in _apply_op_helper
(prefix, dtypes.as_dtype(input_arg.type).name))

TypeError: Input 'filename' of 'ReadFile' Op has type float32 that does not match expected type of string.

The input arguments (image_paths, mask_paths) of "data_batch" in utility.py have to list of strings. Where each string is the path to an image/mask. I think you are passing in float values.