Numpy uses float64 by default if I’m not mistaken, so you should convert your target to float32 before passing it to the loss function using bbox = bbox.float().
As a small side note: Variables are deprecated since PyTorch 0.4.0 so if you are using a newer version (which is highly recommended  ), you can just use tensors instead.