titu1994/neural-image-assessment

errors when i run extract_inception_features.py

Closed this issue · 7 comments

`2019-05-20 14:35:21.557215: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1120] Creating TensorFlow device (/device:GPU:0) -> (device: 0, name: GeForce GTX 1060 3GB, pci bus id: 0000:01:00.0, compute capability: 6.1)
Traceback (most recent call last):
File "/home/jlx/miniconda3/envs/tf-keras/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 510, in _apply_op_helper
preferred_dtype=default_dtype)
File "/home/jlx/miniconda3/envs/tf-keras/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 926, in internal_convert_to_tensor
ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
File "/home/jlx/miniconda3/envs/tf-keras/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 774, in _TensorTensorConversionFunction
(dtype.name, t.dtype.name, str(t)))
ValueError: Tensor conversion requested dtype string for Tensor with dtype float64: 'Tensor("arg0:0", shape=(), dtype=float64)'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "extract_inception_resnet_features.py", line 28, in
x_batch, y_batch = next(generator)
File "/home/jlx/Downloads/Code-Aes/NIMA/neural-image-assessment/utils/data_loader.py", line 101, in train_generator
train_dataset = train_dataset.map(parse_data, num_parallel_calls=2)
File "/home/jlx/miniconda3/envs/tf-keras/lib/python3.6/site-packages/tensorflow/python/data/ops/dataset_ops.py", line 714, in map
return ParallelMapDataset(self, map_func, num_parallel_calls)
File "/home/jlx/miniconda3/envs/tf-keras/lib/python3.6/site-packages/tensorflow/python/data/ops/dataset_ops.py", line 1410, in init
super(ParallelMapDataset, self).init(input_dataset, map_func)
File "/home/jlx/miniconda3/envs/tf-keras/lib/python3.6/site-packages/tensorflow/python/data/ops/dataset_ops.py", line 1385, in init
self._map_func.add_to_graph(ops.get_default_graph())
File "/home/jlx/miniconda3/envs/tf-keras/lib/python3.6/site-packages/tensorflow/python/framework/function.py", line 486, in add_to_graph
self._create_definition_if_needed()
File "/home/jlx/miniconda3/envs/tf-keras/lib/python3.6/site-packages/tensorflow/python/framework/function.py", line 321, in _create_definition_if_needed
self._create_definition_if_needed_impl()
File "/home/jlx/miniconda3/envs/tf-keras/lib/python3.6/site-packages/tensorflow/python/framework/function.py", line 338, in _create_definition_if_needed_impl
outputs = self._func(*inputs)
File "/home/jlx/miniconda3/envs/tf-keras/lib/python3.6/site-packages/tensorflow/python/data/ops/dataset_ops.py", line 1358, in tf_map_func
ret = map_func(*nested_args)
File "/home/jlx/Downloads/Code-Aes/NIMA/neural-image-assessment/utils/data_loader.py", line 61, in parse_data
image = tf.read_file(filename)
File "/home/jlx/miniconda3/envs/tf-keras/lib/python3.6/site-packages/tensorflow/python/ops/gen_io_ops.py", line 376, in read_file
"ReadFile", filename=filename, name=name)
File "/home/jlx/miniconda3/envs/tf-keras/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))
`

my tf=1.4,keras=2.1.3,python=3.6,I am not sure wheater is my version caused it, can you help me?

I recommend TF 1.13.1 and Keras 2.2.4

I use tf 1.12 and keras 2.2.4 and meet the same error ,but thanks the same ,and i will check for it again.
I am a fresh student of tensorflow,code is toooooo hard for me

I have fixed it out,I am soooo stupid to write the path of images wrongly
thank you a lot

Everyone makes silly mistakes haha. Don't worry about it too much. Glad it's fixed c

sorry for disturbing you again ,but I want to know How much memory is the graphics card?
mine is GTX 1060 ,3G, when I run the extracted*.py, it is out of memory .so how much memory I need?

Use a smaller batch size. I was able to do it with batch size of 8 on 4 GB GPU memory.

COPY THAT! THANK YOU !!!