AAMonza01:

  File "/tmp/pycharm_project_453/nn_environment.py", line 267, in train_epochs
    loss = self._loss_fn(predictions[0], targets)



Likely, predictions[0] is a dictionary (probably with a tensor in there) but the loss you feed it to (cross entropy?) expects a tensor.
Sounds to me like your tooling in nn_environment is geared towards classification (only) and does not know how to cope with what the MarkRCNN outputs.
Best regards
Thomas