WeiTang114 / MVCNN-TensorFlow

An Multi-View CNN (MVCNN) implementation with TensorFlow.
MIT License
120 stars 67 forks source link

hi i tried to freeze the model for infrence uses but whenever i tried to run freese graph i get the error #15

Closed vaibhav0195 closed 6 years ago

vaibhav0195 commented 6 years ago

i have frozen the graph till the argmax layer

Traceback (most recent call last): File "/media/ankit/Data/ML/MVCNN-TensorFlow/test_forzen_graph.py", line 130, in predictions = sess.run(output_node, feed_dict={inputnode:[x],y:views}) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 778, in run run_metadata_ptr) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 982, in _run feed_dict_string, options, run_metadata) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1032, in _do_run target_list, options, run_metadata) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1052, in _do_call raise type(e)(node_def, op, message) tensorflow.python.framework.errors_impl.InvalidArgumentError: transpose expects a vector of size 6. But input(1) is a vector of size 5 [[Node: import/transpose = Transpose[T=DT_FLOAT, Tperm=DT_INT32, _device="/job:localhost/replica:0/task:0/gpu:0"](_recv_import/im0_0/_1, import/transpose/perm)]]

Caused by op u'import/transpose', defined at: File "/media/ankit/Data/ML/MVCNN-TensorFlow/test_forzen_graph.py", line 110, in tf.import_graph_def(graph_def) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/importer.py", line 308, in import_graph_def op_def=op_def) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 2336, in create_op original_op=self._default_original_op, op_def=op_def) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 1228, in init self._traceback = _extract_stack()

InvalidArgumentError (see above for traceback): transpose expects a vector of size 6. But input(1) is a vector of size 5 [[Node: import/transpose = Transpose[T=DT_FLOAT, Tperm=DT_INT32, _device="/job:localhost/replica:0/task:0/gpu:0"](_recv_import/im0_0/_1, import/transpose/perm)]]

update:: i think i need to initialise the placeholder variable with some tensor of size 4096 am i correct?

vaibhav0195 commented 6 years ago

i think i found the answer need to assign the placeholder value equal to value 0.5 which is the initial value of the probabilty used for training.