Execute infercode with 2 files failed
allomy opened this issue · comments
Related to https://github.com/bdqnghi/infercode/blob/master/infercode/__main__.py .
Execute infercode
with 1 file succeed.
python3.8 -m infercode file1.c
But execute infercode
with 2 files failed.
python3.8 -m infercode file1.c file2.c
Pasted the error message:
Traceback (most recent call last):
File "/home/username/.local/lib/python3.8/site-packages/tensorflow/python/client/session.py", line 1375, in _do_call
return fn(*args)
File "/home/username/.local/lib/python3.8/site-packages/tensorflow/python/client/session.py", line 1359, in _run_fn
return self._call_tf_sessionrun(options, feed_dict, fetch_list,
File "/home/username/.local/lib/python3.8/site-packages/tensorflow/python/client/session.py", line 1451, in _call_tf_sessionrun
return tf_session.TF_SessionRun_wrapper(self._session, options, feed_dict,
tensorflow.python.framework.errors_impl.NotFoundError: Key dense_2/kernel not found in checkpoint
[[{{node save_1/RestoreV2}}]]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/username/.local/lib/python3.8/site-packages/tensorflow/python/training/saver.py", line 1297, in restore
sess.run(self.saver_def.restore_op_name,
File "/home/username/.local/lib/python3.8/site-packages/tensorflow/python/client/session.py", line 967, in run
result = self._run(None, fetches, feed_dict, options_ptr,
File "/home/username/.local/lib/python3.8/site-packages/tensorflow/python/client/session.py", line 1190, in _run
results = self._do_run(handle, final_targets, final_fetches,
File "/home/username/.local/lib/python3.8/site-packages/tensorflow/python/client/session.py", line 1368, in _do_run
return self._do_call(_run_fn, feeds, fetches, targets, options,
File "/home/username/.local/lib/python3.8/site-packages/tensorflow/python/client/session.py", line 1394, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.NotFoundError: Key dense_2/kernel not found in checkpoint
[[node save_1/RestoreV2 (defined at WorkSpace/infercode/infercode/client/infercode_client.py:45) ]]
Original stack trace for 'save_1/RestoreV2':
File "usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "WorkSpace/infercode/infercode/__main__.py", line 61, in <module>
main()
File "WorkSpace/infercode/infercode/__main__.py", line 53, in main
infercode.init_from_config()
File "WorkSpace/infercode/infercode/client/infercode_client.py", line 45, in init_from_config
self.saver = tf.train.Saver(save_relative_paths=True, max_to_keep=5)
File "home/username/.local/lib/python3.8/site-packages/tensorflow/python/training/saver.py", line 835, in __init__
self.build()
File "home/username/.local/lib/python3.8/site-packages/tensorflow/python/training/saver.py", line 847, in build
self._build(self._filename, build_save=True, build_restore=True)
File "home/username/.local/lib/python3.8/site-packages/tensorflow/python/training/saver.py", line 875, in _build
self.saver_def = self._builder._build_internal( # pylint: disable=protected-access
File "home/username/.local/lib/python3.8/site-packages/tensorflow/python/training/saver.py", line 514, in _build_internal
restore_op = self._AddRestoreOps(filename_tensor, saveables,
File "home/username/.local/lib/python3.8/site-packages/tensorflow/python/training/saver.py", line 334, in _AddRestoreOps
all_tensors = self.bulk_restore(filename_tensor, saveables, preferred_shard,
File "home/username/.local/lib/python3.8/site-packages/tensorflow/python/training/saver.py", line 582, in bulk_restore
return io_ops.restore_v2(filename_tensor, names, slices, dtypes)
File "home/username/.local/lib/python3.8/site-packages/tensorflow/python/ops/gen_io_ops.py", line 1508, in restore_v2
_, _, _op, _outputs = _op_def_library._apply_op_helper(
File "home/username/.local/lib/python3.8/site-packages/tensorflow/python/framework/op_def_library.py", line 748, in _apply_op_helper
op = g._create_op_internal(op_type_name, inputs, dtypes=None,
File "home/username/.local/lib/python3.8/site-packages/tensorflow/python/framework/ops.py", line 3528, in _create_op_internal
ret = Operation(
File "home/username/.local/lib/python3.8/site-packages/tensorflow/python/framework/ops.py", line 1990, in __init__
self._traceback = tf_stack.extract_stack()
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/username/.local/lib/python3.8/site-packages/tensorflow/python/training/py_checkpoint_reader.py", line 69, in get_tensor
return CheckpointReader.CheckpointReader_GetTensor(
RuntimeError: Key _CHECKPOINTABLE_OBJECT_GRAPH not found in checkpoint
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/username/.local/lib/python3.8/site-packages/tensorflow/python/training/saver.py", line 1308, in restore
names_to_keys = object_graph_key_mapping(save_path)
File "/home/username/.local/lib/python3.8/site-packages/tensorflow/python/training/saver.py", line 1626, in object_graph_key_mapping
object_graph_string = reader.get_tensor(trackable.OBJECT_GRAPH_PROTO_KEY)
File "/home/username/.local/lib/python3.8/site-packages/tensorflow/python/training/py_checkpoint_reader.py", line 74, in get_tensor
error_translator(e)
File "/home/username/.local/lib/python3.8/site-packages/tensorflow/python/training/py_checkpoint_reader.py", line 35, in error_translator
raise errors_impl.NotFoundError(None, None, error_message)
tensorflow.python.framework.errors_impl.NotFoundError: Key _CHECKPOINTABLE_OBJECT_GRAPH not found in checkpoint
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/WorkSpace/infercode/infercode/__main__.py", line 61, in <module>
main()
File "/WorkSpace/infercode/infercode/__main__.py", line 53, in main
infercode.init_from_config()
File "/WorkSpace/infercode/infercode/client/infercode_client.py", line 54, in init_from_config
self.saver.restore(self.sess, ckpt.model_checkpoint_path)
File "/home/username/.local/lib/python3.8/site-packages/tensorflow/python/training/saver.py", line 1313, in restore
raise _wrap_restore_error_with_msg(
tensorflow.python.framework.errors_impl.NotFoundError: Restoring from checkpoint failed. This is most likely due to a Variable name or other graph key that is missing from the checkpoint. Please ensure that you have not altered the graph expected based on the checkpoint. Original error:
Key dense_2/kernel not found in checkpoint
[[node save_1/RestoreV2 (defined at WorkSpace/infercode/infercode/client/infercode_client.py:45) ]]
Original stack trace for 'save_1/RestoreV2':
File "usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "WorkSpace/infercode/infercode/__main__.py", line 61, in <module>
main()
File "WorkSpace/infercode/infercode/__main__.py", line 53, in main
infercode.init_from_config()
File "WorkSpace/infercode/infercode/client/infercode_client.py", line 45, in init_from_config
self.saver = tf.train.Saver(save_relative_paths=True, max_to_keep=5)
File "home/username/.local/lib/python3.8/site-packages/tensorflow/python/training/saver.py", line 835, in __init__
self.build()
File "home/username/.local/lib/python3.8/site-packages/tensorflow/python/training/saver.py", line 847, in build
self._build(self._filename, build_save=True, build_restore=True)
File "home/username/.local/lib/python3.8/site-packages/tensorflow/python/training/saver.py", line 875, in _build
self.saver_def = self._builder._build_internal( # pylint: disable=protected-access
File "home/username/.local/lib/python3.8/site-packages/tensorflow/python/training/saver.py", line 514, in _build_internal
restore_op = self._AddRestoreOps(filename_tensor, saveables,
File "home/username/.local/lib/python3.8/site-packages/tensorflow/python/training/saver.py", line 334, in _AddRestoreOps
all_tensors = self.bulk_restore(filename_tensor, saveables, preferred_shard,
File "home/username/.local/lib/python3.8/site-packages/tensorflow/python/training/saver.py", line 582, in bulk_restore
return io_ops.restore_v2(filename_tensor, names, slices, dtypes)
File "home/username/.local/lib/python3.8/site-packages/tensorflow/python/ops/gen_io_ops.py", line 1508, in restore_v2
_, _, _op, _outputs = _op_def_library._apply_op_helper(
File "home/username/.local/lib/python3.8/site-packages/tensorflow/python/framework/op_def_library.py", line 748, in _apply_op_helper
op = g._create_op_internal(op_type_name, inputs, dtypes=None,
File "home/username/.local/lib/python3.8/site-packages/tensorflow/python/framework/ops.py", line 3528, in _create_op_internal
ret = Operation(
File "home/username/.local/lib/python3.8/site-packages/tensorflow/python/framework/ops.py", line 1990, in __init__
self._traceback = tf_stack.extract_stack()