wangdxh / tensorflow-learn

learn tensorflow
46 stars 31 forks source link

NotFoundError: Key Variable_10 not found in checkpoint #1

Open bishopAL opened 6 years ago

bishopAL commented 6 years ago

您好,我采集了两个人的数据,测试您的项目的时候报了下列错误,主要问题似乎是NotFoundError: Key Variable_10 not found in checkpoint,请问您知道怎么解决吗: Traceback (most recent call last):

File "", line 1, in runfile('/home/bingbing/jupyter/classify with python/cnn_face_recognition_forkedfromwang/tensorflow_face.py', wdir='/home/bingbing/jupyter/classify with python/cnn_face_recognition_forkedfromwang')

File "/home/bingbing/anaconda3/lib/python3.6/site-packages/spyder/utils/site/sitecustomize.py", line 705, in runfile execfile(filename, namespace)

File "/home/bingbing/anaconda3/lib/python3.6/site-packages/spyder/utils/site/sitecustomize.py", line 102, in execfile exec(compile(f.read(), filename, 'exec'), namespace)

File "/home/bingbing/jupyter/classify with python/cnn_face_recognition_forkedfromwang/tensorflow_face.py", line 194, in main(0)

File "/home/bingbing/jupyter/classify with python/cnn_face_recognition_forkedfromwang/tensorflow_face.py", line 141, in main testfromcamera(savepath)

File "/home/bingbing/jupyter/classify with python/cnn_face_recognition_forkedfromwang/tensorflow_face.py", line 156, in testfromcamera saver.restore(sess, chkpoint)

File "/home/bingbing/anaconda3/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1802, in restore {self.saver_def.filename_tensor_name: save_path})

File "/home/bingbing/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 900, in run run_metadata_ptr)

File "/home/bingbing/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1135, in _run feed_dict_tensor, options, run_metadata)

File "/home/bingbing/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1316, in _do_run run_metadata)

File "/home/bingbing/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1335, in _do_call raise type(e)(node_def, op, message)

NotFoundError: Key Variable_10 not found in checkpoint [[Node: save_1/RestoreV2 = RestoreV2[dtypes=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, ..., DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save_1/Const_0_0, save_1/RestoreV2/tensor_names, save_1/RestoreV2/shape_and_slices)]] [[Node: save_1/RestoreV2/_45 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device_incarnation=1, tensor_name="edge_50_save_1/RestoreV2", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"]()]]

Caused by op 'save_1/RestoreV2', defined at: File "/home/bingbing/anaconda3/lib/python3.6/site-packages/spyder/utils/ipython/start_kernel.py", line 268, in main() File "/home/bingbing/anaconda3/lib/python3.6/site-packages/spyder/utils/ipython/start_kernel.py", line 264, in main kernel.start() File "/home/bingbing/anaconda3/lib/python3.6/site-packages/ipykernel/kernelapp.py", line 478, in start self.io_loop.start() File "/home/bingbing/anaconda3/lib/python3.6/site-packages/zmq/eventloop/ioloop.py", line 177, in start super(ZMQIOLoop, self).start() File "/home/bingbing/anaconda3/lib/python3.6/site-packages/tornado/ioloop.py", line 888, in start handler_func(fd_obj, events) File "/home/bingbing/anaconda3/lib/python3.6/site-packages/tornado/stack_context.py", line 277, in null_wrapper return fn(*args, kwargs) File "/home/bingbing/anaconda3/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 440, in _handle_events self._handle_recv() File "/home/bingbing/anaconda3/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 472, in _handle_recv self._run_callback(callback, msg) File "/home/bingbing/anaconda3/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 414, in _run_callback callback(*args, *kwargs) File "/home/bingbing/anaconda3/lib/python3.6/site-packages/tornado/stack_context.py", line 277, in null_wrapper return fn(args, kwargs) File "/home/bingbing/anaconda3/lib/python3.6/site-packages/ipykernel/kernelbase.py", line 283, in dispatcher return self.dispatch_shell(stream, msg) File "/home/bingbing/anaconda3/lib/python3.6/site-packages/ipykernel/kernelbase.py", line 233, in dispatch_shell handler(stream, idents, msg) File "/home/bingbing/anaconda3/lib/python3.6/site-packages/ipykernel/kernelbase.py", line 399, in execute_request user_expressions, allow_stdin) File "/home/bingbing/anaconda3/lib/python3.6/site-packages/ipykernel/ipkernel.py", line 208, in do_execute res = shell.run_cell(code, store_history=store_history, silent=silent) File "/home/bingbing/anaconda3/lib/python3.6/site-packages/ipykernel/zmqshell.py", line 537, in run_cell return super(ZMQInteractiveShell, self).run_cell(*args, **kwargs) File "/home/bingbing/anaconda3/lib/python3.6/site-packages/IPython/core/interactiveshell.py", line 2728, in run_cell interactivity=interactivity, compiler=compiler, result=result) File "/home/bingbing/anaconda3/lib/python3.6/site-packages/IPython/core/interactiveshell.py", line 2856, in run_ast_nodes if self.run_code(code, result): File "/home/bingbing/anaconda3/lib/python3.6/site-packages/IPython/core/interactiveshell.py", line 2910, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "", line 1, in runfile('/home/bingbing/jupyter/classify with python/cnn_face_recognition_forkedfromwang/tensorflow_face.py', wdir='/home/bingbing/jupyter/classify with python/cnn_face_recognition_forkedfromwang') File "/home/bingbing/anaconda3/lib/python3.6/site-packages/spyder/utils/site/sitecustomize.py", line 705, in runfile execfile(filename, namespace) File "/home/bingbing/anaconda3/lib/python3.6/site-packages/spyder/utils/site/sitecustomize.py", line 102, in execfile exec(compile(f.read(), filename, 'exec'), namespace) File "/home/bingbing/jupyter/classify with python/cnn_face_recognition_forkedfromwang/tensorflow_face.py", line 194, in main(0) File "/home/bingbing/jupyter/classify with python/cnn_face_recognition_forkedfromwang/tensorflow_face.py", line 141, in main testfromcamera(savepath) File "/home/bingbing/jupyter/classify with python/cnn_face_recognition_forkedfromwang/tensorflow_face.py", line 153, in testfromcamera saver = tf.train.Saver() File "/home/bingbing/anaconda3/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1338, in init self.build() File "/home/bingbing/anaconda3/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1347, in build self._build(self._filename, build_save=True, build_restore=True) File "/home/bingbing/anaconda3/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1384, in _build build_save=build_save, build_restore=build_restore) File "/home/bingbing/anaconda3/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 835, in _build_internal restore_sequentially, reshape) File "/home/bingbing/anaconda3/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 472, in _AddRestoreOps restore_sequentially) File "/home/bingbing/anaconda3/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 886, in bulk_restore return io_ops.restore_v2(filename_tensor, names, slices, dtypes) File "/home/bingbing/anaconda3/lib/python3.6/site-packages/tensorflow/python/ops/gen_io_ops.py", line 1463, in restore_v2 shape_and_slices=shape_and_slices, dtypes=dtypes, name=name) File "/home/bingbing/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper op_def=op_def) File "/home/bingbing/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3392, in create_op op_def=op_def) File "/home/bingbing/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1718, in init self._traceback = self._graph._extract_stack() # pylint: disable=protected-access

NotFoundError (see above for traceback): Key Variable_10 not found in checkpoint [[Node: save_1/RestoreV2 = RestoreV2[dtypes=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, ..., DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save_1/Const_0_0, save_1/RestoreV2/tensor_names, save_1/RestoreV2/shape_and_slices)]] [[Node: save_1/RestoreV2/_45 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device_incarnation=1, tensor_name="edge_50_save_1/RestoreV2", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"]()]]

<matplotlib.figure.Figure at 0x7ffa701ffd68>

YanchongCarolynChen commented 6 years ago

你好,我也遇到了同样的问题,请问你找到解决办法了吗?

bochuanwu commented 6 years ago

我也遇到了 请问解决了么

YanchongCarolynChen commented 6 years ago

我是程序重新运行了一次就可以了

zyftest1 commented 5 years ago

我也遇到了,就是跳不到图像识别最后一步