Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ai_drive not working from cnn trained models. #130

Open
thebaskota opened this issue Jul 21, 2018 · 1 comment
Open

ai_drive not working from cnn trained models. #130

thebaskota opened this issue Jul 21, 2018 · 1 comment

Comments

@thebaskota
Copy link

ai_drive works just fine for other models like glm and Ann but has errors when ran from cnn trained models.
the error is:
tensorflow.python.framework.errors_impl.InvalidArgumentError: You must feed a value for placeholder tensor 'Placeholder' with dtype float
[[Node: Placeholder = Placeholderdtype=DT_FLOAT, shape=, _device="/job:localhost/replica:0/task:0/device:CPU:0"]]

i think the error lies here.
in glm and ann:
x = tf.placeholder(tf.float32, shape=[None, 240, 320, 3], name='x')
y_ = tf.placeholder(tf.float32, shape=[None, 3], name='y_')
x_shaped = tf.reshape(x, [-1, 240 * 320 * 3])

but in cnn:
x = tf.placeholder(tf.float32, shape=[None, 240, 320, 3], name='x')
y_ = tf.placeholder(tf.float32, shape=[None, 3], name='y_')

why do you only reshape for glm and ann.

full error in console:
2018-07-21 11:39:54.144693: W tensorflow/core/framework/allocator.cc:101] Allocation of 629145600 exceeds 10% of system memory.
2018-07-21 11:40:04.581812: W tensorflow/core/framework/allocator.cc:101] Allocation of 629145600 exceeds 10% of system memory.
2018-07-21 11:40:14.998577: W tensorflow/core/framework/allocator.cc:101] Allocation of 629145600 exceeds 10% of system memory.
2018-07-21 11:40:25.908618: W tensorflow/core/framework/allocator.cc:101] Allocation of 629145600 exceeds 10% of system memory.
2018-07-21 11:40:25.908639: W tensorflow/core/framework/allocator.cc:101] Allocation of 629145600 exceeds 10% of system memory.
2018-07-21 11:40:25.908857: W tensorflow/core/framework/allocator.cc:101] Allocation of 629145600 exceeds 10% of system memory.
Exception in thread Prediction thread:
Traceback (most recent call last):
File "/home/the_pradeep/.local/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1322, in _do_call
return fn(*args)
File "/home/the_pradeep/.local/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1307, in _run_fn
options, feed_dict, fetch_list, target_list, run_metadata)
File "/home/the_pradeep/.local/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1409, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.InvalidArgumentError: You must feed a value for placeholder tensor 'Placeholder' with dtype float
[[Node: Placeholder = Placeholderdtype=DT_FLOAT, shape=, _device="/job:localhost/replica:0/task:0/device:CPU:0"]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/usr/lib/python3.6/threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "/home/the_pradeep/PycharmProjects/untitled/CommandCenter.py", line 113, in predict_from_queue
command_index = self.prediction.eval(feed_dict={self.x: normalized_images}, session=self.sess)[0]
File "/home/the_pradeep/.local/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 710, in eval
return _eval_using_default_session(self, feed_dict, self.graph, session)
File "/home/the_pradeep/.local/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 5180, in _eval_using_default_session
return session.run(tensors, feed_dict)
File "/home/the_pradeep/.local/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 900, in run
run_metadata_ptr)
File "/home/the_pradeep/.local/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1135, in _run
feed_dict_tensor, options, run_metadata)
File "/home/the_pradeep/.local/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1316, in _do_run
run_metadata)
File "/home/the_pradeep/.local/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1335, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: You must feed a value for placeholder tensor 'Placeholder' with dtype float
[[Node: Placeholder = Placeholderdtype=DT_FLOAT, shape=, _device="/job:localhost/replica:0/task:0/device:CPU:0"]]

Caused by op 'Placeholder', defined at:
File "/home/the_pradeep/PycharmProjects/untitled/ai_drive.py", line 18, in
command_center = CommandCenter(checkpoint_dir_path=checkpoint_dir_path, ip=ip)
File "/home/the_pradeep/PycharmProjects/untitled/CommandCenter.py", line 32, in init
saver = tf.train.import_meta_graph(checkpoint_dir_path + "/" + graph_name + ".meta")
File "/home/the_pradeep/.local/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1955, in import_meta_graph
**kwargs)
File "/home/the_pradeep/.local/lib/python3.6/site-packages/tensorflow/python/framework/meta_graph.py", line 743, in import_scoped_meta_graph
producer_op_list=producer_op_list)
File "/home/the_pradeep/.local/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 432, in new_func
return func(*args, **kwargs)
File "/home/the_pradeep/.local/lib/python3.6/site-packages/tensorflow/python/framework/importer.py", line 513, in import_graph_def
_ProcessNewOps(graph)
File "/home/the_pradeep/.local/lib/python3.6/site-packages/tensorflow/python/framework/importer.py", line 303, in _ProcessNewOps
for new_op in graph._add_new_tf_operations(compute_devices=False): # pylint: disable=protected-access
File "/home/the_pradeep/.local/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3540, in _add_new_tf_operations
for c_op in c_api_util.new_tf_operations(self)
File "/home/the_pradeep/.local/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3540, in
for c_op in c_api_util.new_tf_operations(self)
File "/home/the_pradeep/.local/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3428, in _create_op_from_tf_operation
ret = Operation(c_op, self)
File "/home/the_pradeep/.local/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1718, in init
self._traceback = self._graph._extract_stack() # pylint: disable=protected-access

InvalidArgumentError (see above for traceback): You must feed a value for placeholder tensor 'Placeholder' with dtype float
[[Node: Placeholder = Placeholderdtype=DT_FLOAT, shape=, _device="/job:localhost/replica:0/task:0/device:CPU:0"]]

@thebaskota
Copy link
Author

Nevermind, Solved it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant