Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

models and data for layer norm#1032

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
alalek merged 5 commits intoopencv:4.xfromfengyuentau:layer_norm
Jan 27, 2023
Merged

Conversation

@fengyuentau
Copy link
Member

@fengyuentaufengyuentau commentedDec 28, 2022
edited
Loading

Merge withopencv/opencv#23047.

Models exceptlayer_norm_expanded.onnx andlayer_norm_expanded_with_intializers.onnx are taken from onnx conformance tests and are modified with the removal of optional outputs (Mean & InvStdDev):

importosimportshutilimportonnxbase_path="./conformance"dst_path="./collected_conformance"defremove_optinoal_output(onnx_file):model=onnx.load(onnx_file)graph=model.graphnodes=graph.node# remove node optional outputs (mean & InvStdDev)node=nodes[0]node.output.remove(node.output[1])node.output.remove(node.output[1])# remove graph optional outputs (mean & InvStdDev)graph.output.remove(graph.output[1])graph.output.remove(graph.output[1])new_model=onnx.helper.make_model(graph,producer_name="backend-test modified by github.com/opencv/opencv_extra")new_model=onnx.shape_inference.infer_shapes(new_model)returnnew_modelfordinos.listdir(base_path):if"expanded"indornotd.startswith("test"):continueonnx_src=os.path.join(base_path,d,"model.onnx")onnx_dst=os.path.join(dst_path,"models","{}.onnx".format(d))new_onnx=remove_optinoal_output(onnx_src)onnx.save(new_onnx,onnx_dst)in0_src=os.path.join(base_path,d,"test_data_set_0","input_0.pb")in0_dst=os.path.join(dst_path,"data","input_{}_0.pb".format(d))shutil.copy2(in0_src,in0_dst)in1_src=os.path.join(base_path,d,"test_data_set_0","input_1.pb")in1_dst=os.path.join(dst_path,"data","input_{}_1.pb".format(d))shutil.copy2(in1_src,in1_dst)in2_src=os.path.join(base_path,d,"test_data_set_0","input_2.pb")in2_dst=os.path.join(dst_path,"data","input_{}_2.pb".format(d))shutil.copy2(in2_src,in2_dst)out0_src=os.path.join(base_path,d,"test_data_set_0","output_0.pb")out0_dst=os.path.join(dst_path,"data","output_{}.pb".format(d))shutil.copy2(out0_src,out0_dst)

@alalekalalek merged commitf467fad intoopencv:4.xJan 27, 2023
@alalekalalek mentioned this pull requestJan 28, 2023
@asmorkalovasmorkalov mentioned this pull requestMay 31, 2023
@fengyuentaufengyuentau deleted the layer_norm branchDecember 3, 2024 03:51
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@fengyuentau@alalek

[8]ページ先頭

©2009-2025 Movatter.jp