Skip to content

ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (5,) + inhomogeneous part. #194

Open
@HardikJain02

Description

@HardikJain02

I crash into this error while executing
python test.py --trained_model=craft_mlt_25k.pth --refiner_model=craft_refiner_CTW1500.pth --test_folder=myfolder --refine

Traceback (most recent call last):
File "C:\code\CRAFT-pytorch\test.py", line 165, in
bboxes, polys, score_text = test_net(net, image, args.text_threshold, args.link_threshold, args.low_text, args.cuda, args.poly, refine_net)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\code\CRAFT-pytorch\test.py", line 106, in test_net
polys = craft_utils.adjustResultCoordinates(polys, ratio_w, ratio_h)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\code\CRAFT-pytorch\craft_utils.py", line 251, in adjustResultCoordinates
polys = np.array(polys)
^^^^^^^^^^^^^^^
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (5,) + inhomogeneous part.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions