Thank you very much @JosephC ! But when I runned this code in the training mode (validation = False), I got this error :
2 frames
<ipython-input-19-3c77990fe1dc> in train_one_epoch_forum_pytorch_(model, optimizer, data_loader, device, validation)
     20         else:
     21             optimizer.zero_grad()
---> 22             predictions = model(images)
     23             print(predictions)
     24             loss_dict = loss_fn(images, targets)

/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py in _call_impl(self, *input, **kwargs)
   1100         if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks or _global_backward_hooks
   1101                 or _global_forward_hooks or _global_forward_pre_hooks):
-> 1102             return forward_call(*input, **kwargs)
   1103         # Do not call functions when jit is used
   1104         full_backward_hooks, non_full_backward_hooks = [], []

/usr/local/lib/python3.7/dist-packages/torchvision/models/detection/generalized_rcnn.py in forward(self, images, targets)
     55         """
     56         if self.training and targets is None:
---> 57             raise ValueError("In training mode, targets should be passed")
     58         if self.training:
     59             assert targets is not None

ValueError: In training mode, targets should be passed

How should I do to extract the prediction in the train mode ?