Skip to content

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

@1995gatch

Description

@1995gatch

您好,我是一名研究生,最近在复现yolo模型,在使用您的代码仓运行时,之前都很顺利,但是在train时却遇到了:Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/client/session.py", line 1365, in _do_call
return fn(*args)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/client/session.py", line 1350, in _run_fn
target_list, run_metadata)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/client/session.py", line 1443, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.UnknownError: 2 root error(s) found.
(0) Unknown: {{function_node _inference_Dataset_map_136}} AttributeError: 'NoneType' object has no attribute 'shape'
Traceback (most recent call last):

File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/ops/script_ops.py", line 235, in call
ret = func(*args)

File "/home/mist/8_3_YOLOv3_tensorflow/utils/data_utils.py", line 215, 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 "/home/mist/8_3_YOLOv3_tensorflow/utils/data_utils.py", line 168, in parse_data
img, boxes = resize_with_bbox(img, boxes, img_size[0], img_size[1], interp=1, letterbox=letterbox_resize)

File "/home/mist/8_3_YOLOv3_tensorflow/utils/data_aug.py", line 302, in resize_with_bbox
image_padded, resize_ratio, dw, dh = letterbox_resize(img, new_width, new_height, interp)

File "/home/mist/8_3_YOLOv3_tensorflow/utils/data_aug.py", line 278, in letterbox_resize
ori_height, ori_width = img.shape[:2]

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

这个问题困扰我两天了还没有解决,谢谢您宝贵的时间,希望您能帮助我解决这个问题,谢谢~

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions