da03 / Attention-OCR

Visual Attention based OCR
MIT License
1.12k stars 363 forks source link

whenrun src/launcher.py, failed reporting error:Tensor name "conv_conv7/BatchNorm/moving_mean" not found in checkpoint files model/translate.ckpt-47200 #43

Open emily2he opened 7 years ago

emily2he commented 7 years ago

I want to test and v this model, but when run src/launcher.py, met error:

2017-06-13 14:02:31,749 root INFO loading data 2017-06-13 14:02:31,750 root INFO phase: test 2017-06-13 14:02:31,750 root INFO model_dir: model 2017-06-13 14:02:31,751 root INFO load_model: True 2017-06-13 14:02:31,751 root INFO output_dir: results 2017-06-13 14:02:31,751 root INFO steps_per_checkpoint: 500 2017-06-13 14:02:31,751 root INFO batch_size: 1 2017-06-13 14:02:31,751 root INFO num_epoch: 1000 2017-06-13 14:02:31,751 root INFO learning_rate: 1 2017-06-13 14:02:31,751 root INFO reg_val: 0 2017-06-13 14:02:31,751 root INFO max_gradient_norm: 5.000000 2017-06-13 14:02:31,751 root INFO clip_gradients: True 2017-06-13 14:02:31,751 root INFO valid_target_length inf 2017-06-13 14:02:31,751 root INFO target_vocab_size: 39 2017-06-13 14:02:31,751 root INFO target_embedding_size: 10.000000 2017-06-13 14:02:31,751 root INFO attn_num_hidden: 128 2017-06-13 14:02:31,752 root INFO attn_num_layers: 2 2017-06-13 14:02:31,752 root INFO visualize: True 2017-06-13 14:02:31,752 root INFO buckets 2017-06-13 14:02:31,752 root INFO [(16, 32), (27, 32), (35, 32), (64, 32), (80, 32)] input_tensor dim: (?, 1, 32, ?) CNN outdim before squeeze: (?, 1, ?, 512) CNN outdim: (?, ?, 512) 2017-06-13 14:03:10,971 root INFO Reading model parameters from model/translate.ckpt-47200 W tensorflow/core/framework/op_kernel.cc:993] Not found: Tensor name "conv_conv7/BatchNorm/moving_mean" not found in checkpoint files model/translate.ckpt-47200 [[Node: save/RestoreV2_21 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/cpu:0"](_recv_save/Const_0, save/RestoreV2_21/tensor_names, save/RestoreV2_21/shape_and_slices)]] W tensorflow/core/framework/op_kernel.cc:993] Not found: Tensor name "conv_conv7/BatchNorm/moving_mean" not found in checkpoint files model/translate.ckpt-47200 [[Node: save/RestoreV2_21 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/cpu:0"](_recv_save/Const_0, save/RestoreV2_21/tensor_names, save/RestoreV2_21/shape_and_slices)]] W tensorflow/core/framework/op_kernel.cc:993] Not found: Tensor name "conv_conv7/BatchNorm/moving_mean" not found in checkpoint files model/translate.ckpt-47200 [[Node: save/RestoreV2_21 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/cpu:0"](_recv_save/Const_0, save/RestoreV2_21/tensor_names, save/RestoreV2_21/shape_and_slices)]] W tensorflow/core/framework/op_kernel.cc:993] Not found: Tensor name "conv_conv7/BatchNorm/moving_mean" not found in checkpoint files model/translate.ckpt-47200 [[Node: save/RestoreV2_21 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/cpu:0"](_recv_save/Const_0, save/RestoreV2_21/tensor_names, save/RestoreV2_21/shape_and_slices)]] Traceback (most recent call last): File "src/launcher.py", line 156, in main(sys.argv[1:], exp_config.ExpConfig) File "src/launcher.py", line 152, in main session = sess) File "/home/amax/hexx/text_rcnn_test/Attention-OCR/src/model/model.py", line 204, in init self.saver_all.restore(self.sess, ckpt.model_checkpoint_path) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 1439, in restore {self.saver_def.filename_tensor_name: save_path}) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 767, in run run_metadata_ptr) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 965, in _run feed_dict_string, options, run_metadata) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1015, in _do_run target_list, options, run_metadata) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1035, in _do_call raise type(e)(node_def, op, message) tensorflow.python.framework.errors_impl.NotFoundError: Tensor name "conv_conv7/BatchNorm/moving_mean" not found in checkpoint files model/translate.ckpt-47200 [[Node: save/RestoreV2_21 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/cpu:0"](_recv_save/Const_0, save/RestoreV2_21/tensor_names, save/RestoreV2_21/shape_and_slices)]] [[Node: save/RestoreV2_29/_23 = _Recv[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_250_save/RestoreV2_29", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/gpu:0"]()]]

Caused by op u'save/RestoreV2_21', defined at: File "src/launcher.py", line 156, in main(sys.argv[1:], exp_config.ExpConfig) File "src/launcher.py", line 152, in main session = sess) File "/home/amax/hexx/text_rcnn_test/Attention-OCR/src/model/model.py", line 198, in init self.saver_all = tf.train.Saver(tf.all_variables()) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 1051, in init self.build() File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 1081, in build restore_sequentially=self._restore_sequentially) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 675, in build restore_sequentially, reshape) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 402, in _AddRestoreOps tensors = self.restore_op(filename_tensor, saveable, preferred_shard) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 242, in restore_op [spec.tensor.dtype])[0]) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gen_io_ops.py", line 668, in restore_v2 dtypes=dtypes, name=name) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_def_library.py", line 763, in apply_op op_def=op_def) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 2395, 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 1264, in init self._traceback = _extract_stack()

NotFoundError (see above for traceback): Tensor name "conv_conv7/BatchNorm/moving_mean" not found in checkpoint files model/translate.ckpt-47200 [[Node: save/RestoreV2_21 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/cpu:0"](_recv_save/Const_0, save/RestoreV2_21/tensor_names, save/RestoreV2_21/shape_and_slices)]] [[Node: save/RestoreV2_29/_23 = _Recv[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_250_save/RestoreV2_29", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/gpu:0"]()]]

Anyone who know the reason ,please help me solve this problem. thanks.

badripatro commented 7 years ago

HI, I am getting the same error mentioned above using pre-trained model. Are there any updates or any solution on this issue?

pasha76 commented 6 years ago

Hi any update? I am getting the same...

Intsigstephon commented 6 years ago

HI, I am getting the similar error: Tensor name "conv_conv5/BatchNorm/beta" not found in checkpoint

XuXuanhui commented 5 years ago

em. you need the model (wget http://www.cs.cmu.edu/~yuntiand/model.tgz ;tar zxf model.tgz)but it still have another problem . so I suggest you to train buy youserlf.

XuXuanhui commented 5 years ago

I want to test and v this model, but when run src/launcher.py, met error:

2017-06-13 14:02:31,749 root INFO loading data 2017-06-13 14:02:31,750 root INFO phase: test 2017-06-13 14:02:31,750 root INFO model_dir: model 2017-06-13 14:02:31,751 root INFO load_model: True 2017-06-13 14:02:31,751 root INFO output_dir: results 2017-06-13 14:02:31,751 root INFO steps_per_checkpoint: 500 2017-06-13 14:02:31,751 root INFO batch_size: 1 2017-06-13 14:02:31,751 root INFO num_epoch: 1000 2017-06-13 14:02:31,751 root INFO learning_rate: 1 2017-06-13 14:02:31,751 root INFO reg_val: 0 2017-06-13 14:02:31,751 root INFO max_gradient_norm: 5.000000 2017-06-13 14:02:31,751 root INFO clip_gradients: True 2017-06-13 14:02:31,751 root INFO valid_target_length inf 2017-06-13 14:02:31,751 root INFO target_vocab_size: 39 2017-06-13 14:02:31,751 root INFO target_embedding_size: 10.000000 2017-06-13 14:02:31,751 root INFO attn_num_hidden: 128 2017-06-13 14:02:31,752 root INFO attn_num_layers: 2 2017-06-13 14:02:31,752 root INFO visualize: True 2017-06-13 14:02:31,752 root INFO buckets 2017-06-13 14:02:31,752 root INFO [(16, 32), (27, 32), (35, 32), (64, 32), (80, 32)] input_tensor dim: (?, 1, 32, ?) CNN outdim before squeeze: (?, 1, ?, 512) CNN outdim: (?, ?, 512) 2017-06-13 14:03:10,971 root INFO Reading model parameters from model/translate.ckpt-47200 W tensorflow/core/framework/op_kernel.cc:993] Not found: Tensor name "conv_conv7/BatchNorm/moving_mean" not found in checkpoint files model/translate.ckpt-47200 [[Node: save/RestoreV2_21 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/cpu:0"](_recv_save/Const_0, save/RestoreV2_21/tensor_names, save/RestoreV2_21/shape_and_slices)]] W tensorflow/core/framework/op_kernel.cc:993] Not found: Tensor name "conv_conv7/BatchNorm/moving_mean" not found in checkpoint files model/translate.ckpt-47200 [[Node: save/RestoreV2_21 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/cpu:0"](_recv_save/Const_0, save/RestoreV2_21/tensor_names, save/RestoreV2_21/shape_and_slices)]] W tensorflow/core/framework/op_kernel.cc:993] Not found: Tensor name "conv_conv7/BatchNorm/moving_mean" not found in checkpoint files model/translate.ckpt-47200 [[Node: save/RestoreV2_21 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/cpu:0"](_recv_save/Const_0, save/RestoreV2_21/tensor_names, save/RestoreV2_21/shape_and_slices)]] W tensorflow/core/framework/op_kernel.cc:993] Not found: Tensor name "conv_conv7/BatchNorm/moving_mean" not found in checkpoint files model/translate.ckpt-47200 [[Node: save/RestoreV2_21 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/cpu:0"](_recv_save/Const_0, save/RestoreV2_21/tensor_names, save/RestoreV2_21/shape_and_slices)]] Traceback (most recent call last): File "src/launcher.py", line 156, in main(sys.argv[1:], exp_config.ExpConfig) File "src/launcher.py", line 152, in main session = sess) File "/home/amax/hexx/text_rcnn_test/Attention-OCR/src/model/model.py", line 204, in init self.saver_all.restore(self.sess, ckpt.model_checkpoint_path) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 1439, in restore {self.saver_def.filename_tensor_name: save_path}) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 767, in run run_metadata_ptr) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 965, in _run feed_dict_string, options, run_metadata) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1015, in _do_run target_list, options, run_metadata) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1035, in _do_call raise type(e)(node_def, op, message) tensorflow.python.framework.errors_impl.NotFoundError: Tensor name "conv_conv7/BatchNorm/moving_mean" not found in checkpoint files model/translate.ckpt-47200 [[Node: save/RestoreV2_21 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/cpu:0"](_recv_save/Const_0, save/RestoreV2_21/tensor_names, save/RestoreV2_21/shape_and_slices)]] [[Node: save/RestoreV2_29/_23 = _Recvclient_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_250_save/RestoreV2_29", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/gpu:0"]]

Caused by op u'save/RestoreV2_21', defined at: File "src/launcher.py", line 156, in main(sys.argv[1:], exp_config.ExpConfig) File "src/launcher.py", line 152, in main session = sess) File "/home/amax/hexx/text_rcnn_test/Attention-OCR/src/model/model.py", line 198, in init self.saver_all = tf.train.Saver(tf.all_variables()) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 1051, in init self.build() File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 1081, in build restore_sequentially=self._restore_sequentially) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 675, in build restore_sequentially, reshape) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 402, in _AddRestoreOps tensors = self.restore_op(filename_tensor, saveable, preferred_shard) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 242, in restore_op [spec.tensor.dtype])[0]) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gen_io_ops.py", line 668, in restore_v2 dtypes=dtypes, name=name) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_def_library.py", line 763, in apply_op op_def=op_def) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 2395, 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 1264, in init self._traceback = _extract_stack()

NotFoundError (see above for traceback): Tensor name "conv_conv7/BatchNorm/moving_mean" not found in checkpoint files model/translate.ckpt-47200 [[Node: save/RestoreV2_21 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/cpu:0"](_recv_save/Const_0, save/RestoreV2_21/tensor_names, save/RestoreV2_21/shape_and_slices)]] [[Node: save/RestoreV2_29/_23 = _Recvclient_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_250_save/RestoreV2_29", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/gpu:0"]]

Anyone who know the reason ,please help me solve this problem. thanks. em. you need the model (wget http://www.cs.cmu.edu/~yuntiand/model.tgz ;tar zxf model.tgz)but it still have another problem . so I suggest you to train buy youserlf. if you need trained model.give me your email I can send you one