-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part. #47
Comments
have you able to solve it ? |
No, I don’t where problem is with I even tried to change numpy versions, but didn’t worked. |
excuse me,have you able to solve it ? |
I also encountered this problem,this error becourse this line code:contours = np.subtract(contours, 1)The previous line of code for this got a list object and this list's length >1,it's original length should have been 1,so,you should keep only one of these elements |
also encountered this problem yes, measure.find_contours() returns more than one mask. contours = measure.find_contours(padded_binary_mask, 0.5)
contours=sorted(contours,key=lambda x: len(x),reverse=True)[0:1]#可能返回多个mask
contours = np.subtract(contours, 1) |
可是如果一个物体被遮挡成不相连的两部分,应该是要保留这两部分的mask吧?这种情况有办法解决吗? |
我也是这个问题,求助大佬解决了吗??? |
@waspinator this is still a problem |
#51 This edit should fix it. |
(venv) root@cc3180440f4b:/opendr/src/opendr/perception/panoptic_segmentation/efficient_ps/algorithm/EfficientPS# python tools/convert_cityscapes.py ./data_2/ ./data/cityscapes/
Loading Cityscapes from ./data_2/
Converting train ...
0%| | 0/2975 [00:00<?, ?it/s]
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "/usr/lib/python3.8/multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "/usr/lib/python3.8/multiprocessing/pool.py", line 48, in mapstar
return list(map(*args))
File "tools/convert_cityscapes.py", line 163, in call
coco_ann_i = pct.create_annotation_info(
File "/opendr/venv/lib/python3.8/site-packages/pycococreatortools/pycococreatortools.py", line 99, in create_annotation_info
segmentation = binary_mask_to_polygon(binary_mask, tolerance)
File "/opendr/venv/lib/python3.8/site-packages/pycococreatortools/pycococreatortools.py", line 48, in binary_mask_to_polygon
contours = np.subtract(contours, 1)
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part.
I am trying to convert my Citscapes dataset to COCO style using pycococreator with following subfolder.
Inside gtFine->train-><city_name>->following items
1.aachen_000057_000019_gtFine_color.png
aachen_000057_000019_gtFine_instanceIds.png
aachen_000057_000019_gtFine_labelIds.png
aachen_000057_000019_gtFine_polygons.json
How can I solve the above ValueError issue?
The text was updated successfully, but these errors were encountered: