Relation-Classification-using-Bidirectional-LSTM-Tree icon indicating copy to clipboard operation
Relation-Classification-using-Bidirectional-LSTM-Tree copied to clipboard

unable to execute completely

Open srinathdwivedi opened this issue 7 years ago • 9 comments

i am trying to run modelv1. now at following stage new error is occurring: model = tf.train.latest_checkpoint(model_dir) saver.restore(sess, model) error: INFO:tensorflow:Restoring parameters from None


TypeError Traceback (most recent call last) TypeError: expected bytes, NoneType found

The above exception was the direct cause of the following exception:

SystemError Traceback (most recent call last) in () 1 model = tf.train.latest_checkpoint(model_dir) ----> 2 saver.restore(sess, model)

/home/snd/anaconda3/lib/python3.6/site-packages/tensorflow/python/training/saver.py 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/snd/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py 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/snd/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py 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/snd/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py 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/snd/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py in _do_call(self, fn, *args) 1137 def _do_call(self, fn, *args): 1138 try: -> 1139 return fn(*args) 1140 except errors.OpError as e: 1141 message = compat.as_text(e.message)

/home/snd/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py in _run_fn(session, feed_dict, fetch_list, target_list, options, run_metadata) 1119 return tf_session.TF_Run(session, options, 1120 feed_dict, fetch_list, target_list, -> 1121 status, run_metadata) 1122 1123 def _prun_fn(session, handle, feed_dict, fetch_list):

SystemError: <built-in function TF_Run> returned a result with an error set

i would like to know why it is occurring is there any sequence to run different models?

srinathdwivedi avatar Jun 27 '18 07:06 srinathdwivedi

got a different error: Can't load save_path when it is None. although i think thats because its the first time training and there is no saved model yet since training involves saver.save(sess, model_dir + '/model')

so i skipped running that cell and ran all below, and got another error: InvalidArgumentError: Inputs to operation gradients_1/AddN_973 of type AddN must have the same size and shape. Input 0: [2,7,1,100] != input 1: [2,1,1,100] [[Node: gradients_1/AddN_973 = AddN[N=6, T=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"](gradients_1/while_62/Merge_7_grad/Switch:1, gradients_1/while_62/lstm_btup/while_2/strided_slice/Enter_grad/b_acc_2, gradients_1/while_62/lstm_btup/while_5/while/strided_slice/Enter_grad/b_acc_2, gradients_1/while_62/lstm_btup/while_1/strided_slice/Enter_grad/b_acc_2, gradients_1/while_62/lstm_btup/while_3/strided_slice/Enter_grad/b_acc_2, gradients_1/while_62/lstm_btup/while_4/while/strided_slice/Enter_grad/b_acc_2)]] [[Node: gradients_1/Switch_1319/_5281 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge_94916_gradients_1/Switch_1319", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:CPU:0"](^_cloopgradients_1/hidden_layer_seq/while_9/cond/concat_grad/ShapeN/StackPushV2_1/Switch/_164)]]

ProxyCausal avatar Jun 30 '18 20:06 ProxyCausal

are you using python3?

Sshanu avatar Jul 02 '18 08:07 Sshanu

Yes

On Mon, Jul 2, 2018, 4:31 AM Shanu Kumar [email protected] wrote:

are you using python3?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Sshanu/Relation-Classification/issues/12#issuecomment-401711267, or mute the thread https://github.com/notifications/unsubscribe-auth/AmSqYBU4N2IVs73FyIh-6d_F_Yk_COqHks5uCdpjgaJpZM4U5OpL .

ProxyCausal avatar Jul 02 '18 09:07 ProxyCausal

yes i also using python3

srinathdwivedi avatar Jul 02 '18 11:07 srinathdwivedi

https://github.com/Sshanu/Relation-Classification/issues/9

Sshanu avatar Jul 02 '18 13:07 Sshanu

someone was also facing the same issue, you can ask them

Sshanu avatar Jul 02 '18 13:07 Sshanu

@ProxyCasual Hi, have you solved the problem you meet? Input 0: [2,7,1,100] != input 1: [2,1,1,100]. How did you solve it?

zy158 avatar May 14 '19 08:05 zy158

Have you solved this problem? I have the same problem.

Traceback (most recent call last): File "D:/test/Relation-Classification-using-Bidirectional-LSTM-Tree-master/LCA Shortest Path/modelv4.py", line 249, in word_embedding_saver.restore(sess, latest_embd) File "C:\Users\damao\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\training\saver.py", line 1769, in restore raise ValueError("Can't load save_path when it is None.") ValueError: Can't load save_path when it is None.

damao666 avatar Jul 21 '19 06:07 damao666

Facing the same problem :

ValueError Traceback (most recent call last) in () 1 model = tf.train.latest_checkpoint(model_dir) ----> 2 saver.restore(sess, model)

F:\anaconda\lib\site-packages\tensorflow\python\training\saver.py in restore(self, sess, save_path) 1272 return 1273 if save_path is None: -> 1274 raise ValueError("Can't load save_path when it is None.") 1275 1276 if not checkpoint_management.checkpoint_exists(compat.as_text(save_path)):

ValueError: Can't load save_path when it is None.

Please help I am new learner.

radhikagupta6 avatar Dec 12 '19 23:12 radhikagupta6