miendinh / VietnameseOCR

Vietnamese Optical Character Recognition. It works with Vietnamese and Latin characters as well.
Apache License 2.0
72 stars 40 forks source link

After training getting these lots of errors #3

Closed saurabhbidwai closed 6 years ago

saurabhbidwai commented 6 years ago

E:\Shezartech\OCR\Vietnamese\VietnameseOCR-master>python train.py 2018-10-08 11:08:33.824304: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 Done shuffle dataset! WARNING:tensorflow:From E:\Shezartech\OCR\Vietnamese\VietnameseOCR-master\model.py:123: softmax_cross_entropy_with_logits (from tensorflow.python.ops.nn_ops) is deprecated and will be removed in a future version. Instructions for updating:

Future major versions of TensorFlow will allow gradients to flow into the labels input on backprop by default.

See tf.nn.softmax_cross_entropy_with_logits_v2.

Training... Epoch: 01 cost = 6.886777639 Epoch: 02 cost = 5.465170531 Epoch: 03 cost = 5.437775334 Epoch: 04 cost = 5.423924650 Epoch: 05 cost = 5.408748928 Epoch: 06 cost = 5.372752797 Epoch: 07 cost = 4.914058918 Epoch: 08 cost = 4.291090060 Epoch: 09 cost = 3.637334304 Epoch: 10 cost = 2.976472312 Epoch: 11 cost = 2.508758491 Epoch: 12 cost = 2.038119041 Epoch: 13 cost = 1.585568683 Epoch: 14 cost = 1.298715894 Epoch: 15 cost = 1.099691014 Epoch: 16 cost = 0.957667396 Epoch: 17 cost = 0.862675724 Epoch: 18 cost = 0.787035389 Epoch: 19 cost = 0.721239509 Epoch: 20 cost = 0.664576864 Epoch: 21 cost = 0.622479543 Epoch: 22 cost = 0.580160727 Epoch: 23 cost = 0.549833339 Epoch: 24 cost = 0.516690385 Epoch: 25 cost = 0.490436088 Epoch: 26 cost = 0.463827107 Epoch: 27 cost = 0.438583468 Epoch: 28 cost = 0.417645685 Epoch: 29 cost = 0.402110323 Epoch: 30 cost = 0.379509842 Epoch: 31 cost = 0.369229207 Epoch: 32 cost = 0.358186685 Epoch: 33 cost = 0.343487738 Epoch: 34 cost = 0.333546966 Epoch: 35 cost = 0.324272395 Epoch: 36 cost = 0.314847696 Epoch: 37 cost = 0.303071091 Epoch: 38 cost = 0.298055138 Epoch: 39 cost = 0.287200178 Epoch: 40 cost = 0.277841558 Training finished! 2018-10-08 13:18:32.800596: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at save_restore_v2_ops.cc:109 : Not found: Failed to create a directory: ; No such file or directory Traceback (most recent call last): File "C:\Users\DELL\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1292, in _do_call return fn(*args) File "C:\Users\DELL\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1277, in _run_fn options, feed_dict, fetch_list, target_list, run_metadata) File "C:\Users\DELL\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1367, in _call_tf_sessionrun run_metadata) tensorflow.python.framework.errors_impl.NotFoundError: Failed to create a directory: ; No such file or directory [[{{node save/SaveV2}} = SaveV2[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/Const_0_0, save/SaveV2/tensor_names, save/SaveV2/shape_and_slices, beta1_power, beta2_power, conv1/biases, conv1/biases/Adam, conv1/biases/Adam_1, conv1/weights, conv1/weights/Adam, conv1/weights/Adam_1, conv2/biases, conv2/biases/Adam, conv2/biases/Adam_1, conv2/weights, conv2/weights/Adam, conv2/weights/Adam_1, conv3/biases, conv3/biases/Adam, conv3/biases/Adam_1, conv3/weights, conv3/weights/Adam, conv3/weights/Adam_1, fc1/Variable, fc1/Variable/Adam, fc1/Variable/Adam_1, fc1w, fc1w/Adam, fc1w/Adam_1, fc2/Variable, fc2/Variable/Adam, fc2/Variable/Adam_1, fc2w, fc2w/Adam, fc2w/Adam_1)]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\DELL\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 1433, in save {self.saver_def.filename_tensor_name: checkpoint_file}) File "C:\Users\DELL\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 887, in run run_metadata_ptr) File "C:\Users\DELL\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1110, in _run feed_dict_tensor, options, run_metadata) File "C:\Users\DELL\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1286, in _do_run run_metadata) File "C:\Users\DELL\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1308, in _do_call raise type(e)(node_def, op, message) tensorflow.python.framework.errors_impl.NotFoundError: Failed to create a directory: ; No such file or directory [[{{node save/SaveV2}} = SaveV2[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/Const_0_0, save/SaveV2/tensor_names, save/SaveV2/shape_and_slices, beta1_power, beta2_power, conv1/biases, conv1/biases/Adam, conv1/biases/Adam_1, conv1/weights, conv1/weights/Adam, conv1/weights/Adam_1, conv2/biases, conv2/biases/Adam, conv2/biases/Adam_1, conv2/weights, conv2/weights/Adam, conv2/weights/Adam_1, conv3/biases, conv3/biases/Adam, conv3/biases/Adam_1, conv3/weights, conv3/weights/Adam, conv3/weights/Adam_1, fc1/Variable, fc1/Variable/Adam, fc1/Variable/Adam_1, fc1w, fc1w/Adam, fc1w/Adam_1, fc2/Variable, fc2/Variable/Adam, fc2/Variable/Adam_1, fc2w, fc2w/Adam, fc2w/Adam_1)]]

Caused by op 'save/SaveV2', defined at: File "train.py", line 9, in vocr.train(learning_rate=0.001, training_epochs=40, batch_size=1000, keep_prob=0.7) File "E:\Shezartech\OCR\Vietnamese\VietnameseOCR-master\model.py", line 160, in train saver = tf.train.Saver() File "C:\Users\DELL\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 1094, in init self.build() File "C:\Users\DELL\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 1106, in build self._build(self._filename, build_save=True, build_restore=True) File "C:\Users\DELL\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 1143, in _build build_save=build_save, build_restore=build_restore) File "C:\Users\DELL\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 784, in _build_internal save_tensor = self._AddSaveOps(filename_tensor, saveables) File "C:\Users\DELL\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 284, in _AddSaveOps save = self.save_op(filename_tensor, saveables) File "C:\Users\DELL\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 202, in save_op tensors) File "C:\Users\DELL\Anaconda3\lib\site-packages\tensorflow\python\ops\gen_io_ops.py", line 1803, in save_v2 shape_and_slices=shape_and_slices, tensors=tensors, name=name) File "C:\Users\DELL\Anaconda3\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 787, in _apply_op_helper op_def=op_def) File "C:\Users\DELL\Anaconda3\lib\site-packages\tensorflow\python\util\deprecation.py", line 488, in new_func return func(*args, **kwargs) File "C:\Users\DELL\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 3272, in create_op op_def=op_def) File "C:\Users\DELL\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 1768, in init self._traceback = tf_stack.extract_stack()

NotFoundError (see above for traceback): Failed to create a directory: ; No such file or directory [[{{node save/SaveV2}} = SaveV2[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/Const_0_0, save/SaveV2/tensor_names, save/SaveV2/shape_and_slices, beta1_power, beta2_power, conv1/biases, conv1/biases/Adam, conv1/biases/Adam_1, conv1/weights, conv1/weights/Adam, conv1/weights/Adam_1, conv2/biases, conv2/biases/Adam, conv2/biases/Adam_1, conv2/weights, conv2/weights/Adam, conv2/weights/Adam_1, conv3/biases, conv3/biases/Adam, conv3/biases/Adam_1, conv3/weights, conv3/weights/Adam, conv3/weights/Adam_1, fc1/Variable, fc1/Variable/Adam, fc1/Variable/Adam_1, fc1w, fc1w/Adam, fc1w/Adam_1, fc2/Variable, fc2/Variable/Adam, fc2/Variable/Adam_1, fc2w, fc2w/Adam, fc2w/Adam_1)]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "train.py", line 9, in vocr.train(learning_rate=0.001, training_epochs=40, batch_size=1000, keep_prob=0.7) File "E:\Shezartech\OCR\Vietnamese\VietnameseOCR-master\model.py", line 161, in train save_path = saver.save(self.sess, "viet_ocr_brain.ckpt") File "C:\Users\DELL\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 1450, in save raise exc ValueError: Parent directory of viet_ocr_brain.ckpt doesn't exist, can't save.

saurabhbidwai commented 6 years ago

after providing an absolute path to "viet_ocr_brain.ckpt" it worked fine