Issue 1:
System Information

System: Ubuntu 20.04

Complier: GCC 7.5.0

OpenCV version: 4.7.0 (build from source)

Torch version: 2.0.0+cpu

Torchvision version: 0.15.1+cpu

Onnx version: 1.11.0

Detailed description

Following assertion in raised when TopK layer is being parsed. It seems that TopK layer in C++ is absent.

[ INFO:0@0.967] global onnx_importer.cpp:1006 handleNode DNN/ONNX: processing node with 2 inputs and 2 outputs: [TopK]:(onnx_node!/TopK) from domain='ai.onnx'
[ INFO:0@0.968] global onnx_importer.cpp:3333 parseCustomLayer DNN/ONNX: unknown node type, try using custom handler for node with 2 inputs and 2 outputs: [TopK]:(onnx_node!/TopK)
OpenCV(4.7.0-dev) Error: Unspecified error (Can't create layer "onnx_node!/TopK" of type "TopK") in getLayerInstance, file opencv/modules/dnn/src/net_impl.hpp, line 108
[ERROR:0@0.968] global onnx_importer.cpp:1064 handleNode DNN/ONNX: ERROR during processing node with 2 inputs and 2 outputs: [TopK]:(onnx_node!/TopK) from domain='ai.onnx'
[ INFO:0@0.968] global onnx_importer.cpp:1068 handleNode Input[0] = 'input'
[ INFO:0@0.968] global onnx_importer.cpp:1068 handleNode Input[1] = '/Constant_output_0'
[ INFO:0@0.968] global onnx_importer.cpp:1072 handleNode Output[0] = 'output'
[ INFO:0@0.968] global onnx_importer.cpp:1072 handleNode Output[1] = '5'
OpenCV(4.7.0-dev) Error: Unspecified error (> Node [TopK@ai.onnx]:(onnx_node!/TopK) parse error: OpenCV(4.7.0-dev) opencv/modules/dnn/src/net_impl.hpp:108: error: (-2:Unspecified error) Can't create layer "onnx_node!/TopK" of type "TopK" in function 'getLayerInstance'
> ) in handleNode, file opencv/modules/dnn/src/onnx/onnx_importer.cpp, line 1083
[DEBUG:0@0.968] global system.cpp:2881 restoreFPDenormalsState core: restore FP mxcsr flags = 0x00001fa3
Traceback (most recent call last):
File "topk.py", line 43, in <module>
opencv_net = cv2.dnn.readNetFromONNX(full_model_path)
cv2.error: OpenCV(4.7.0-dev) opencv/modules/dnn/src/onnx/onnx_importer.cpp:1083: error: (-2:Unspecified error) in function 'handleNode'

Steps to reproduce

import cv2
import onnx, os
import torch
import torch.nn as nn
from onnx import shape_inference
from onnxsim import simplify

class TopK(nn.Module):

def forward(self, x):
return torch.topk(x, 3)

if __name__ == "__main__":

onnx_model_path = "models"
onnx_model_name = "topk.onnx"
full_model_path = os.path.join(onnx_model_path, onnx_model_name)

topk = TopK()
x = torch.arange(1., 6.)
v, i = topk(x)

torch.onnx.export(
topk,
x,
full_model_path,
verbose=False,
input_names=["input"],
output_names=["output"],
opset_version=11
)

onnx_model = onnx.load(full_model_path)
onnx.checker.check_model(onnx_model)

onnx_model = shape_inference.infer_shapes(onnx_model)
onnx.save(onnx_model, full_model_path)

opencv_net = cv2.dnn.readNetFromONNX(full_model_path)

Issue submission checklist

I report the issue, it's not a question

I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution

I updated to the latest OpenCV version and the issue is still there

There is reproducer code and related data files (videos, images, onnx, etc)

Issue 2:
System information (version)

OpenCV => :4.0

Operating System / Platform => : linux mint (ubuntu 16.04) 64 bit

Compiler => :gcc

Detailed description

when i have run the command make -j4 .

I got error with description that

"

/anaconda3/lib/libgsttag-1.0.so.0: undefined reference to gst_make_element_message_details' /anaconda3/lib/libgsttag-1.0.so.0: undefined reference to gst_element_message_full_with_details'

collect2: error: ld returned 1 exit status

modules/videoio/CMakeFiles/opencv_test_videoio.dir/build.make:286: recipe for target 'bin/opencv_test_videoio' failed

make[2]: *** [bin/opencv_test_videoio] Error 1

CMakeFiles/Makefile2:9038: recipe for target 'modules/videoio/CMakeFiles/opencv_test_videoio.dir/all' failed

make[1]: *** [modules/videoio/CMakeFiles/opencv_test_videoio.dir/all] Error 2

make[1]: *** Waiting for unfinished jobs....

"

This was the error .

I have tried to install all dependencies several times but i have got same result.

Steps to reproduce

cmake -D CMAKE_BUILD_TYPE=RELEASE

-D CMAKE_INSTALL_PREFIX=$cwd/installation/OpenCV-"$cvVersion"

-D INSTALL_C_EXAMPLES=ON

-D INSTALL_PYTHON_EXAMPLES=ON

-D WITH_TBB=ON

-D WITH_V4L=ON

-D OPENCV_PYTHON3_INSTALL_PATH=$cwd/OpenCV-$cvVersion-py3/lib/python3.5/site-packages

-D WITH_QT=ON

-D WITH_OPENGL=ON

-D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules

-D BUILD_EXAMPLES=ON ..

then i have use make -j4