OK, I don’t know where to get the data from to run into the issue and debug it.
I think the best way forward would be, if you could add:
print(images.min(), images.max(), images.shape)
print(targets.min(), targets.max(), targets.shape)

before calling loss_dict = model(images, targets) in train_one_epoch.
This should give us some information about potentially invalid inputs.