AssertionError: Arrays are not almost equal to 2 decimals
AllanHLL opened this issue · 4 comments
I am sorry to bother you. When I run: "python3 -m unittest discover -s tests/", the VOC dataset works fine, but when I use my own dataset (also in VOC format) I get the following error: AssertionError: Arrays are not almost equal to 2 decimals. Can you tell me why there is such an error? Thank you so much!
我也遇到了,你解决了吗
I am sorry to bother you. When I run: "python3 -m unittest discover -s tests/", the VOC dataset works fine, but when I use my own dataset (also in VOC format) I get the following error: AssertionError: Arrays are not almost equal to 2 decimals. Can you tell me why there is such an error? Thank you so much!
Hi, have you solved the problem? I met it too...
FOR VOC format
change the code to this
xmin = int("{:.0f}".format(float(obj.findtext("bndbox/xmin")))) / width
ymin = int("{:.0f}".format(float(obj.findtext("bndbox/ymin")))) / height
xmax = int("{:.0f}".format(float(obj.findtext("bndbox/xmax")))) / width
ymax = int("{:.0f}".format(float(obj.findtext("bndbox/ymax")))) / height
see my comment below
I am sorry to bother you. When I run: "python3 -m unittest discover -s tests/", the VOC dataset works fine, but when I use my own dataset (also in VOC format) I get the following error: AssertionError: Arrays are not almost equal to 2 decimals. Can you tell me why there is such an error? Thank you so much!
Hi, have you solved the problem? I met it too...