Sorry, but I think you are misinterpreting the symptoms. What do you mean you can’t print and see values? I don’t have any trouble putting print statements in the iou code.
In the first test case, the inter_area is 1 and the union_area is 7. Here’s the output I get:
inter_area 1
union_area 7
iou for intersecting boxes = 0.14285714285714285