Training breaks halfway, Although restartable, but it break again frequently
Training could start, but breaks halfway. I had to restart several times from where it last breaks. Although it looks like hardware limitation, however i'm using a powerful laptop, Windows 10, GTX1060 GPU, 16GB DDR3, Intel i7&-7700HQ 2.8GHz, installed Cuda 9.0 and cudnn 7.05. I hope someone can give me advise on this. Thank you.
Below shows training in progress, and break error.
INFO:tensorflow:global step 345: loss = 0.2802 (0.166 sec/step)
INFO:tensorflow:global step 346: loss = 0.8893 (0.191 sec/step)
INFO:tensorflow:global step 346: loss = 0.8893 (0.191 sec/step)
2018-05-29 12:27:57.173433: W T:\src\github\tensorflow\tensorflow\core\framework\op_kernel.cc:1318] OP_REQUIRES failed at queue_ops.cc:105 : Invalid argument: Shape mismatch in tuple component 16. Expected [1,?,?,3], got [1,1,591,500,3]
INFO:tensorflow:Error reported to Coordinator: <class 'tensorflow.python.framework.errors_impl.InvalidArgumentError'>, Shape mismatch in tuple component 16. Expected [1,?,?,3], got [1,1,591,500,3]
[[Node: batch/padding_fifo_queue_enqueue = QueueEnqueueV2[Tcomponents=[DT_STRING, DT_INT32, DT_FLOAT, DT_INT32, DT_FLOAT, ..., DT_INT32, DT_INT32, DT_INT32, DT_STRING, DT_INT32], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/device:CPU:0"](batch/padding_fifo_queue, IteratorGetNext, Shape_9, IteratorGetNext:1, Shape_5, RandomHorizontalFlip/cond_1/Merge, Shape_1, IteratorGetNext:3, Shape_10, IteratorGetNext:4, Shape_8, IteratorGetNext:5, Shape_6, IteratorGetNext:6, Shape, IteratorGetNext:7, Shape_2, ExpandDims_1, Shape_4, IteratorGetNext:9, Shape_9, IteratorGetNext:10, Shape_9, IteratorGetNext:11, Shape_9)]]
INFO:tensorflow:Error reported to Coordinator: <class 'tensorflow.python.framework.errors_impl.InvalidArgumentError'>, Shape mismatch in tuple component 16. Expected [1,?,?,3], got [1,1,591,500,3]
[[Node: batch/padding_fifo_queue_enqueue = QueueEnqueueV2[Tcomponents=[DT_STRING, DT_INT32, DT_FLOAT, DT_INT32, DT_FLOAT, ..., DT_INT32, DT_INT32, DT_INT32, DT_STRING, DT_INT32], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/device:CPU:0"](batch/padding_fifo_queue, IteratorGetNext, Shape_9, IteratorGetNext:1, Shape_5, RandomHorizontalFlip/cond_1/Merge, Shape_1, IteratorGetNext:3, Shape_10, IteratorGetNext:4, Shape_8, IteratorGetNext:5, Shape_6, IteratorGetNext:6, Shape, IteratorGetNext:7, Shape_2, ExpandDims_1, Shape_4, IteratorGetNext:9, Shape_9, IteratorGetNext:10, Shape_9, IteratorGetNext:11, Shape_9)]]
INFO:tensorflow:global step 347: loss = 0.4380 (0.185 sec/step)
INFO:tensorflow:global step 347: loss = 0.4380 (0.185 sec/step)
INFO:tensorflow:Finished training! Saving model to disk.
INFO:tensorflow:Finished training! Saving model to disk.
Traceback (most recent call last):
File "train.py", line 184, in
(tensorflow1) C:\tensorflow1\models\research\object_detection>
have you found a solution for this issue?
Maybe you are using images in other format than jpg/jpeg. TfRecords works only for JPEG format images.
All the images are jpg. But I'm still getting the issue.
Hi, did you already solved this problem?
Has anyone managed to solve this issue? I have been stuck on it for quite some time and I can't seem to find any solution. I first did it in JPG and had the problem, then did it in JPEG and the problem still persisted. Any help will be greatly appreciated, I'm extremely frustrated, I don't know what's wrong as not many people are facing this issue. I tried editing the shape in evals_util.py but it didn't seem to make a difference.
Check your train and test CSV files to see if there are any entries with Width and Height as 0. This usually happens if the image is of different format to its extension. Solve the issue by either removing those images or convert them to proper format using -
img = cv2.imread(test_full_path)
cv2.imwrite(test_full_path, img, [int(cv2.IMWRITE_JPEG_QUALITY), 100])
Good Luck!
@nkvuradi you are a life saver. I somehow overlooked that causing the issue, the amount of despair it caused. I moved on to a different model, glad to finally fix the issue for good!