-
-
Notifications
You must be signed in to change notification settings - Fork 55.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert single layer caffe tests to onnx format #25581
Open
WanliZhong
wants to merge
28
commits into
opencv:5.x
Choose a base branch
from
WanliZhong:singleCaffeLayer2onnx
base: 5.x
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+34
−195
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WanliZhong
added
test
category: dnn
cleanup
Code cleanup (e.g, drop legacy C-API, legacy unmaintained code)
OpenCV5
labels
May 14, 2024
This was referenced May 14, 2024
asmorkalov
changed the title
Convert single caffe tests to onnx format
Convert single layer caffe tests to onnx format
May 14, 2024
I removed some layer tests because ONNX doesn't support them. Please leave comments if I should try to keep some of them. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Merged with: opencv/opencv_extra#1176 (testdata also should be review)
part of #25314
This PR is used to convert all caffe tests with 'single' layer to onnx format. Tests in
test_int8_layer.cpp
andtest_caffe_importer.cpp
will be removed in #25323Most layers converted by caffe2onnx
Some of them are generated by
pytorch
andonnxruntime
Some of them are wrong after converting, so I use onnx-modifier to correct it.
EXTRA NOTE
Remove
layer_lrn_spatial
: norm_region isWITHIN_CHANNEL
, but ONNX defines the default mode asACROSS_CHANNELS
, and if users want it, they may tryBatchNormalization
. (ref: LRN in ONNX)Change
layer_deconvolution
: onnx doesn't definedeconvolution
operator, useConvTranspose
to replace. (ref: ConvTranspose in ONNX)Remove
InnerProduct
: ONNX doesn't define this layer, user may convert it to GEMM or MatMulChange
layer_mvn
: onnx doesn't defineMVN
operator, useInstanceNormalization
to replace.Remove
layer_batch_norm_local_stats
:use_global_stats: false
is useless in ONNX. (ref: BatchNormalization in ONNX)Remove
layer_eltwise
: the model has a node with 2 inputs but from the same layer, which then causes an error. However, we have enough eltwise tests.Remove
accum
andaccum_ref
: they use1x2x2x4
accum1x3x8x12
, we can't useADD
operator to replace it.Remove
flow_wrap
: ONNX doesn't define this operator.Remove
DataAugmentation
: ONNX doesn't define this operator.Remove
nearest_2inps
andnearest
: ONNX doesn't defineResample
operator.Remove
Correlation
: ONNX doesn't define this operator.Remove
conv_2_inps
: ONNX doesn't support this defination, no need to test it in ONNX.Remove
layer_interp
: ONNX doesn't defineInterp
operator.Disabled
net_roi_pooling
: can be replaced byRoiAlign
operator in ONNX, but OpenCV dnn doesn't support.Remove
reshape_splice_split
: Can't be converted to ONNX format. Because there are many re-use layers in caffe format.Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.