wizyoung / YOLOv3_TensorFlow

Complete YOLO v3 TensorFlow implementation. Support training on your own dataset.
MIT License
1.55k stars 580 forks source link

AttributeError: 'NoneType' object has no attribute 'shape' #221

Closed pgirikishore closed 4 years ago

pgirikishore commented 4 years ago

34%|████████████████████████████████████████████████████████████████▏ | 100/293 [02:05<03:44, 1.17s/it]Epoch: 0, global_step: 100 | loss: total: 2210.86, xy: 7.96, wh: 32.78, conf: 1194.11, class: 976.02 | Last batch: rec: 0.543, prec: 0.001 | lr: 1.1377e-05 68%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▎ | 200/293 [03:54<00:43, 2.12it/s]Epoch: 0, global_step: 200 | loss: total: 1280.63, xy: 8.11, wh: 20.98, conf: 609.81, class: 641.73 | Last batch: rec: 0.036, prec: 0.000 | lr: 2.2753e-05 91%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▋ | 266/293 [04:43<00:19, 1.37it/s]2020-03-21 21:21:08.619127: W tensorflow/core/framework/op_kernel.cc:1639] Unknown: AttributeError: 'NoneType' object has no attribute 'shape' Traceback (most recent call last):

File "C:\Users\girik\Anaconda3\envs\prac\lib\site-packages\tensorflow_core\python\ops\script_ops.py", line 235, in call ret = func(*args)

File "C:\Users\girik\Desktop\Phase2\YOLOv3_TensorFlow-master\utils\data_utils.py", line 214, in get_batch_data img_idx, img, y_true_13, y_true_26, y_true_52 = parse_data(line, class_num, img_size, anchors, mode, letterbox_resize)

File "C:\Users\girik\Desktop\Phase2\YOLOv3_TensorFlow-master\utils\data_utils.py", line 140, in parse_data img, boxes = mix_up(img1, img2, boxes1, boxes2)

File "C:\Users\girik\Desktop\Phase2\YOLOv3_TensorFlow-master\utils\data_aug.py", line 18, in mix_up height = max(img1.shape[0], img2.shape[0])

AttributeError: 'NoneType' object has no attribute 'shape'

96%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▎ | 281/293 [04:58<00:11, 1.06it/s]Traceback (most recent call last): File "C:\Users\girik\Anaconda3\envs\prac\lib\site-packages\tensorflow_core\python\client\session.py", line 1365, in _do_call return fn(*args) File "C:\Users\girik\Anaconda3\envs\prac\lib\site-packages\tensorflow_core\python\client\session.py", line 1350, in _run_fn target_list, run_metadata) File "C:\Users\girik\Anaconda3\envs\prac\lib\site-packages\tensorflow_core\python\client\session.py", line 1443, in _call_tf_sessionrun run_metadata) tensorflow.python.framework.errors_impl.UnknownError: {{function_node __inference_Datasetmap_6456}} AttributeError: 'NoneType' object has no attribute 'shape' Traceback (most recent call last):

File "C:\Users\girik\Anaconda3\envs\prac\lib\site-packages\tensorflow_core\python\ops\script_ops.py", line 235, in call ret = func(*args)

File "C:\Users\girik\Desktop\Phase2\YOLOv3_TensorFlow-master\utils\data_utils.py", line 214, in get_batch_data img_idx, img, y_true_13, y_true_26, y_true_52 = parse_data(line, class_num, img_size, anchors, mode, letterbox_resize)

File "C:\Users\girik\Desktop\Phase2\YOLOv3_TensorFlow-master\utils\data_utils.py", line 140, in parse_data img, boxes = mix_up(img1, img2, boxes1, boxes2)

File "C:\Users\girik\Desktop\Phase2\YOLOv3_TensorFlow-master\utils\data_aug.py", line 18, in mix_up height = max(img1.shape[0], img2.shape[0])

AttributeError: 'NoneType' object has no attribute 'shape'

     [[{{node PyFunc}}]]
     [[IteratorGetNext]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "train.py", line 140, in feed_dict={is_training: True}) File "C:\Users\girik\Anaconda3\envs\prac\lib\site-packages\tensorflow_core\python\client\session.py", line 956, in run run_metadata_ptr) File "C:\Users\girik\Anaconda3\envs\prac\lib\site-packages\tensorflow_core\python\client\session.py", line 1180, in _run feed_dict_tensor, options, run_metadata) File "C:\Users\girik\Anaconda3\envs\prac\lib\site-packages\tensorflow_core\python\client\session.py", line 1359, in _do_run run_metadata) File "C:\Users\girik\Anaconda3\envs\prac\lib\site-packages\tensorflow_core\python\client\session.py", line 1384, in _do_call raise type(e)(node_def, op, message) tensorflow.python.framework.errors_impl.UnknownError: {{function_node __inference_Datasetmap_6456}} AttributeError: 'NoneType' object has no attribute 'shape' Traceback (most recent call last):

File "C:\Users\girik\Anaconda3\envs\prac\lib\site-packages\tensorflow_core\python\ops\script_ops.py", line 235, in call ret = func(*args)

File "C:\Users\girik\Desktop\Phase2\YOLOv3_TensorFlow-master\utils\data_utils.py", line 214, in get_batch_data img_idx, img, y_true_13, y_true_26, y_true_52 = parse_data(line, class_num, img_size, anchors, mode, letterbox_resize)

File "C:\Users\girik\Desktop\Phase2\YOLOv3_TensorFlow-master\utils\data_utils.py", line 140, in parse_data img, boxes = mix_up(img1, img2, boxes1, boxes2)

File "C:\Users\girik\Desktop\Phase2\YOLOv3_TensorFlow-master\utils\data_aug.py", line 18, in mix_up height = max(img1.shape[0], img2.shape[0])

AttributeError: 'NoneType' object has no attribute 'shape'

     [[{{node PyFunc}}]]
     [[IteratorGetNext]]

96%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▎ | 281/293 [04:58<00:12, 1.06s/it]

RaphaelX commented 4 years ago

How did you solve this ?

qaazii commented 4 years ago

How did you solve it ?

djsamyak commented 3 years ago

I resolved this error by manually creating train.txt with each parameter separated by a space (' '). Make sure that you use absolute paths, it will not work will absolute paths.