{"action":"created","issue":{"url":"https://api.github.com/repos/lars76/kmeans-anchor-boxes/issues/4","repository_url":"https://api.github.com/repos/lars76/kmeans-anchor-boxes","labels_url":"https://api.github.com/repos/lars76/kmeans-anchor-boxes/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/lars76/kmeans-anchor-boxes/issues/4/comments","events_url":"https://api.github.com/repos/lars76/kmeans-anchor-boxes/issues/4/events","html_url":"https://github.com/lars76/kmeans-anchor-boxes/issues/4","id":324704503,"number":4,"title":"在coco数据集上无法得到anchors","user":{"login":"zqdeepbluesky","id":32493711,"avatar_url":"https://avatars0.githubusercontent.com/u/32493711?v=4","gravatar_id":"","url":"https://api.github.com/users/zqdeepbluesky","html_url":"https://github.com/zqdeepbluesky","followers_url":"https://api.github.com/users/zqdeepbluesky/followers","following_url":"https://api.github.com/users/zqdeepbluesky/following{/other_user}","gists_url":"https://api.github.com/users/zqdeepbluesky/gists{/gist_id}","starred_url":"https://api.github.com/users/zqdeepbluesky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zqdeepbluesky/subscriptions","organizations_url":"https://api.github.com/users/zqdeepbluesky/orgs","repos_url":"https://api.github.com/users/zqdeepbluesky/repos","events_url":"https://api.github.com/users/zqdeepbluesky/events{/privacy}","received_events_url":"https://api.github.com/users/zqdeepbluesky/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-20T12:09:14Z","updated_at":"2018-05-20T13:04:02Z","closed_at":"2018-05-20T13:02:04Z","author_association":"NONE","body":"hi，@lars76 \r\n你好，好久不见，我最近想在coco数据集上进行训练和测试。我把coco的annotations格式制作成xml的格式，xml的格式如下：\r\n\r\n```\r\n-<annotation>\r\n   <folder>1</folder>\r\n   <filename>COCO_train2014_000000000036.jpg</filename>\r\n  -<source>\r\n     <database>CKdemo</database>\r\n     <annotation>VOC</annotation>\r\n     <image>CK</image>\r\n   </source>\r\n  -<size>\r\n     <width>481</width>\r\n     <height>640</height>\r\n     <depth>3</depth>\r\n   </size>\r\n   <segmented>0</segmented>\r\n  -<object>\r\n     <name>person</name>\r\n     <pose/>\r\n     <truncated>0</truncated>\r\n     <difficult>0</difficult>\r\n    -<bndbox>\r\n       <xmin>167</xmin>\r\n       <ymin>162</ymin>\r\n       <xmax>478</xmax>\r\n       <ymax>628</ymax>\r\n     </bndbox>\r\n   </object>\r\n </annotation>\r\n\r\n```\r\n然后我使用你提供的k-means代码进行聚类，但是我得到了如下的错误：\r\n\r\ndxt@dxt-System-Product-Name:~/kmeans-anchor-boxes-master$ python example.py\r\nTraceback (most recent call last):\r\n  File \"example.py\", line 32, in <module>\r\n    out = kmeans(data, k=CLUSTERS)\r\n  File \"/home/dxt/kmeans-anchor-boxes-master/kmeans.py\", line 68, in kmeans\r\n    distances[row] = 1 - iou(boxes[row], clusters)\r\n  File \"/home/dxt/kmeans-anchor-boxes-master/kmeans.py\", line 14, in iou\r\n    raise ValueError(\"Box has no area\")\r\nValueError: Box has no area\r\n\r\n然而我不清楚我的xml格式是哪地方出现的错误，我对比了一下我和voc的xml文件，不过还是没能找到问题，你能帮帮我吗？万分感谢，祝你生活愉快。\r\n\r\n对了还有下面这一句话是什么意思，你能告诉我吗，谢谢啦。\r\n```\r\n    x = np.minimum(clusters[:, 0], box[0])\r\n    y = np.minimum(clusters[:, 1], box[1])\r\n    if np.count_nonzero(x == 0) > 0 or np.count_nonzero(y == 0) > 0:\r\n        raise ValueError(\"Box has no area\")\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/lars76/kmeans-anchor-boxes/issues/comments/390481123","html_url":"https://github.com/lars76/kmeans-anchor-boxes/issues/4#issuecomment-390481123","issue_url":"https://api.github.com/repos/lars76/kmeans-anchor-boxes/issues/4","id":390481123,"user":{"login":"zqdeepbluesky","id":32493711,"avatar_url":"https://avatars0.githubusercontent.com/u/32493711?v=4","gravatar_id":"","url":"https://api.github.com/users/zqdeepbluesky","html_url":"https://github.com/zqdeepbluesky","followers_url":"https://api.github.com/users/zqdeepbluesky/followers","following_url":"https://api.github.com/users/zqdeepbluesky/following{/other_user}","gists_url":"https://api.github.com/users/zqdeepbluesky/gists{/gist_id}","starred_url":"https://api.github.com/users/zqdeepbluesky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zqdeepbluesky/subscriptions","organizations_url":"https://api.github.com/users/zqdeepbluesky/orgs","repos_url":"https://api.github.com/users/zqdeepbluesky/repos","events_url":"https://api.github.com/users/zqdeepbluesky/events{/privacy}","received_events_url":"https://api.github.com/users/zqdeepbluesky/received_events","type":"User","site_admin":false},"created_at":"2018-05-20T13:04:02Z","updated_at":"2018-05-20T13:04:02Z","author_association":"NONE","body":"非常抱歉打扰你，我发现问题了，原因是我没有在python3下运行这个代码，而是在python2中运行的，所以出现了错误，再次谢谢你的代码，真的写的非常棒，祝你身体健康。"}}
{"actor":{"display_login":"zqdeepbluesky"}}