Repository: opencv
Issue: Kernel Restarting (Jupyter Notebook)
Labels: incomplete,category: 3rdparty

##### System information (version)
<!-- Example
- OpenCV => 4.2
- Operating System / Platform => Windows 64 Bit
- Compiler => Visual Studio 2017
-->

- OpenCV => 4.5.1
- Operating System / Platform => Ubuntu (version: 20.04)  
- Compiler => Jupyter Notebook

##### Detailed description
I'm trying to train a face recognization model using `face_LBPHFaceRecognizer()` but everytime I try to train my model using `face_recognizer.train(faces,labels)` my kernel gets automatically restarted **(The kernel appears to have died. It will restart automatically)**
  
<!-- your description -->

##### Steps to reproduce
 ```.py
import cv2 as cv
import numpy as np
import os

#assume that my code has required data in *faces* and *labels* variables

face_recognizer = cv.face_LBPHFaceRecognizer()
face_recognizer.train(faces,labels)  
```

<!-- to add code example fence it with triple backticks and optional file extension
    ```.cpp
    // C++ code example
    ```
 or attach as .txt or .zip file
-->
![Screenshot from 2021-01-22 11-00-26](https://user-images.githubusercontent.com/44035546/105458600-ea4e5880-5cae-11eb-8ba3-e4b9b7e9cd25.png)


##### Issue submission checklist

 - [x] I report the issue, it's not a question
   <!--
   OpenCV team works with forum.opencv.org, Stack Overflow and other communities
   to discuss problems. Tickets with question without real issue statement will be
   closed.
   -->
 - [x] I checked the problem with documentation, FAQ, open issues,
       forum.opencv.org, Stack Overflow, etc and have not found solution
   <!--
   Places to check:
   * OpenCV documentation: https://docs.opencv.org
   * FAQ page: https://github.com/opencv/opencv/wiki/FAQ
   * OpenCV forum: https://forum.opencv.org
   * OpenCV issue tracker: https://github.com/opencv/opencv/issues?q=is%3Aissue
   * Stack Overflow branch: https://stackoverflow.com/questions/tagged/opencv
   -->
 - [x] I updated to latest OpenCV version and the issue is still there
   <!--
   master branch for OpenCV 4.x and 3.4 branch for OpenCV 3.x releases.
   OpenCV team supports only latest release for each branch.
   The ticket is closed, if the problem is not reproduced with modern version.
   -->
 - [x] There is reproducer code and related data files: videos, images, onnx, etc
   <!--
   The best reproducer -- test case for OpenCV that we can add to the library.
   Recommendations for media files and binary files:
   * Try to reproduce the issue with images and videos in opencv_extra repository
     to reduce attachment size
   * Use PNG for images, if you report some CV related bug, but not image reader
     issue
   * Attach the image as archive to the ticket, if you report some reader issue.
     Image hosting services compress images and it breaks the repro code.
   * Provide ONNX file for some public model or ONNX file with with random weights,
     if you report ONNX parsing or handling issue. Architecture details diagram
     from netron tool can be very useful too. See https://lutzroeder.github.io/netron/
   -->