Repository: opencv
Issue: Loading Tensorflow model. Error: Unspecified error (More than one input is Const op) in cv::dnn::dnn4_v20200310
Labels: feature,category: dnn

##### System information (version)

- OpenCV => 4.3
- Operating System / Platform => Windows 10 64 Bit
- Compiler => Visual Studio 2017
- GPU NVIDIA GTX 1660 TI (6 GB)
- Processor Intel Core i7-9700F (8 x 3.00 Hz)

##### Detailed description

I need to run model [DenseDepth](https://github.com/ialhashim/DenseDepth), with nyu.pth weights (stored at repo). I successfully converted weights to Tensorflow format (pb-file). [Link on Tensorflow weights file](https://drive.google.com/file/d/1oOgUj3P3xlXBp56_D0Py2q4GQ0jpcOk8/view?usp=sharing).

For model loading, I use `dnn-samples.sln` that could be find at `OpenCV_DIR\build\samples\dnn`. Mode - Debug/x64. As test project I use `(sample) object_detection`.

After code execution, I get the following result:
```cmd
OpenCV(4.3.0-dev) Error: Unspecified error (More than one input is Const op) in cv::dnn::dnn4_v20200310::`anonymous-namespace'::TFImporter::getConstBlob, file E:\Windows\Git\opencv\modules\dnn\src\tensorflow\tf_importer.cpp, line 570
```

##### Steps to reproduce
1. Open `OpenCV_DIR\build\samples\dnn` directory.
2. Launch `dnn-samples.sln`
3. Change mode to Debug/x64
4. Open solution properties
5. In tab Common Properties->Startup Project choose `Multiple startup projects` and change `(sample) object_detection` action to Start
![image](https://user-images.githubusercontent.com/32719347/97169698-872a5400-179b-11eb-8a55-04dc7dd0e9de.png)
6. Change source code of `object_detection.cpp` to attached file [object_detection.txt](https://github.com/opencv/opencv/files/5438610/object_detection.txt)
7. Change line 132 to your model path
```cpp
std::string modelPath = "YOUR_MODEL_PATH\\nyu.pb";
```
8. Press 'Start'

##### Issue submission checklist

 - [x] I report the issue, it's not a question
   <!--
   OpenCV team works with answers.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,
       answers.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://answers.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/
   -->