We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Hi , I have trained the model on the local machine. Then when I run the evaluate_model.ipynb, I get an error at
solver.test(test, split='val')
Do you have a clue? The error output:
INFO:tensorflow:Restoring parameters from ./model/lstm/model-18 --------------------------------------------------------------------------- InvalidArgumentError Traceback (most recent call last) <ipython-input-5-5b76702d1b6f> in <module>() ----> 1 solver.test(data, split='val') /home/allen/Documents/ImageCaption/show-attend-and-tell/core/solver.pyc in test(self, data, split, attention_visualization, save_sampled_captions) 202 with tf.Session(config=config) as sess: 203 saver = tf.train.Saver() --> 204 saver.restore(sess, self.test_model) 205 features_batch, image_files = sample_coco_minibatch(data, self.batch_size) 206 feed_dict = { self.model.features: features_batch } /home/allen/anaconda3/envs/python2/lib/python2.7/site-packages/tensorflow/python/training/saver.pyc in restore(self, sess, save_path) 1546 logging.info("Restoring parameters from %s", save_path) 1547 sess.run(self.saver_def.restore_op_name, -> 1548 {self.saver_def.filename_tensor_name: save_path}) 1549 1550 @staticmethod /home/allen/anaconda3/envs/python2/lib/python2.7/site-packages/tensorflow/python/client/session.pyc in run(self, fetches, feed_dict, options, run_metadata) 787 try: 788 result = self._run(None, fetches, feed_dict, options_ptr, --> 789 run_metadata_ptr) 790 if run_metadata: 791 proto_data = tf_session.TF_GetBuffer(run_metadata_ptr) /home/allen/anaconda3/envs/python2/lib/python2.7/site-packages/tensorflow/python/client/session.pyc in _run(self, handle, fetches, feed_dict, options, run_metadata) 995 if final_fetches or final_targets: 996 results = self._do_run(handle, final_targets, final_fetches, --> 997 feed_dict_string, options, run_metadata) 998 else: 999 results = [] /home/allen/anaconda3/envs/python2/lib/python2.7/site-packages/tensorflow/python/client/session.pyc in _do_run(self, handle, target_list, fetch_list, feed_dict, options, run_metadata) 1130 if handle is None: 1131 return self._do_call(_run_fn, self._session, feed_dict, fetch_list, -> 1132 target_list, options, run_metadata) 1133 else: 1134 return self._do_call(_prun_fn, self._session, handle, feed_dict, /home/allen/anaconda3/envs/python2/lib/python2.7/site-packages/tensorflow/python/client/session.pyc in _do_call(self, fn, *args) 1150 except KeyError: 1151 pass -> 1152 raise type(e)(node_def, op, message) 1153 1154 def _extend_graph(self): InvalidArgumentError: Assign requires shapes of both tensors to match. lhs shape= [1500,512] rhs shape= [1024,512] [[Node: save/Assign_1 = Assign[T=DT_FLOAT, _class=["loc:@attention_layer/w"], use_locking=true, validate_shape=true, _device="/job:localhost/replica:0/task:0/gpu:0"](attention_layer/w, save/RestoreV2_1/_23)]] [[Node: save/RestoreV2_14/_8 = _Send[T=DT_FLOAT, client_terminated=false, recv_device="/job:localhost/replica:0/task:0/gpu:0", send_device="/job:localhost/replica:0/task:0/cpu:0", send_device_incarnation=1, tensor_name="edge_56_save/RestoreV2_14", _device="/job:localhost/replica:0/task:0/cpu:0"](save/RestoreV2_14)]] Caused by op u'save/Assign_1', defined at: File "/home/allen/anaconda3/envs/python2/lib/python2.7/runpy.py", line 174, in _run_module_as_main "__main__", fname, loader, pkg_name) File "/home/allen/anaconda3/envs/python2/lib/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "/home/allen/anaconda3/envs/python2/lib/python2.7/site-packages/ipykernel_launcher.py", line 16, in <module> app.launch_new_instance() File "/home/allen/anaconda3/envs/python2/lib/python2.7/site-packages/traitlets/config/application.py", line 658, in launch_instance app.start() File "/home/allen/anaconda3/envs/python2/lib/python2.7/site-packages/ipykernel/kernelapp.py", line 486, in start self.io_loop.start() File "/home/allen/anaconda3/envs/python2/lib/python2.7/site-packages/tornado/ioloop.py", line 1064, in start handler_func(fd_obj, events) File "/home/allen/anaconda3/envs/python2/lib/python2.7/site-packages/tornado/stack_context.py", line 276, in null_wrapper return fn(*args, **kwargs) File "/home/allen/anaconda3/envs/python2/lib/python2.7/site-packages/zmq/eventloop/zmqstream.py", line 450, in _handle_events self._handle_recv() File "/home/allen/anaconda3/envs/python2/lib/python2.7/site-packages/zmq/eventloop/zmqstream.py", line 480, in _handle_recv self._run_callback(callback, msg) File "/home/allen/anaconda3/envs/python2/lib/python2.7/site-packages/zmq/eventloop/zmqstream.py", line 432, in _run_callback callback(*args, **kwargs) File "/home/allen/anaconda3/envs/python2/lib/python2.7/site-packages/tornado/stack_context.py", line 276, in null_wrapper return fn(*args, **kwargs) File "/home/allen/anaconda3/envs/python2/lib/python2.7/site-packages/ipykernel/kernelbase.py", line 283, in dispatcher return self.dispatch_shell(stream, msg) File "/home/allen/anaconda3/envs/python2/lib/python2.7/site-packages/ipykernel/kernelbase.py", line 233, in dispatch_shell handler(stream, idents, msg) File "/home/allen/anaconda3/envs/python2/lib/python2.7/site-packages/ipykernel/kernelbase.py", line 399, in execute_request user_expressions, allow_stdin) File "/home/allen/anaconda3/envs/python2/lib/python2.7/site-packages/ipykernel/ipkernel.py", line 208, in do_execute res = shell.run_cell(code, store_history=store_history, silent=silent) File "/home/allen/anaconda3/envs/python2/lib/python2.7/site-packages/ipykernel/zmqshell.py", line 537, in run_cell return super(ZMQInteractiveShell, self).run_cell(*args, **kwargs) File "/home/allen/anaconda3/envs/python2/lib/python2.7/site-packages/IPython/core/interactiveshell.py", line 2714, in run_cell interactivity=interactivity, compiler=compiler, result=result) File "/home/allen/anaconda3/envs/python2/lib/python2.7/site-packages/IPython/core/interactiveshell.py", line 2824, in run_ast_nodes if self.run_code(code, result): File "/home/allen/anaconda3/envs/python2/lib/python2.7/site-packages/IPython/core/interactiveshell.py", line 2878, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "<ipython-input-5-5b76702d1b6f>", line 1, in <module> solver.test(data, split='val') File "core/solver.py", line 203, in test saver = tf.train.Saver() File "/home/allen/anaconda3/envs/python2/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 1139, in __init__ self.build() File "/home/allen/anaconda3/envs/python2/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 1170, in build restore_sequentially=self._restore_sequentially) File "/home/allen/anaconda3/envs/python2/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 691, in build restore_sequentially, reshape) File "/home/allen/anaconda3/envs/python2/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 419, in _AddRestoreOps assign_ops.append(saveable.restore(tensors, shapes)) File "/home/allen/anaconda3/envs/python2/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 155, in restore self.op.get_shape().is_fully_defined()) File "/home/allen/anaconda3/envs/python2/lib/python2.7/site-packages/tensorflow/python/ops/state_ops.py", line 271, in assign validate_shape=validate_shape) File "/home/allen/anaconda3/envs/python2/lib/python2.7/site-packages/tensorflow/python/ops/gen_state_ops.py", line 45, in assign use_locking=use_locking, name=name) File "/home/allen/anaconda3/envs/python2/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 767, in apply_op op_def=op_def) File "/home/allen/anaconda3/envs/python2/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2506, in create_op original_op=self._default_original_op, op_def=op_def) File "/home/allen/anaconda3/envs/python2/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1269, in __init__ self._traceback = _extract_stack() InvalidArgumentError (see above for traceback): Assign requires shapes of both tensors to match. lhs shape= [1500,512] rhs shape= [1024,512] [[Node: save/Assign_1 = Assign[T=DT_FLOAT, _class=["loc:@attention_layer/w"], use_locking=true, validate_shape=true, _device="/job:localhost/replica:0/task:0/gpu:0"](attention_layer/w, save/RestoreV2_1/_23)]] [[Node: save/RestoreV2_14/_8 = _Send[T=DT_FLOAT, client_terminated=false, recv_device="/job:localhost/replica:0/task:0/gpu:0", send_device="/job:localhost/replica:0/task:0/cpu:0", send_device_incarnation=1, tensor_name="edge_56_save/RestoreV2_14", _device="/job:localhost/replica:0/task:0/cpu:0"](save/RestoreV2_14)]]
The text was updated successfully, but these errors were encountered:
should be solved in PR78
Sorry, something went wrong.
No branches or pull requests
Hi , I have trained the model on the local machine. Then when I run the evaluate_model.ipynb, I get an error at
Do you have a clue? The error output:
The text was updated successfully, but these errors were encountered: