Skip to content
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

Refactor sonnx, test cases and examples #703

Merged
merged 3 commits into from
Jun 5, 2020
Merged

Conversation

joddiy
Copy link
Member

@joddiy joddiy commented May 18, 2020

todo-list:

  1. sonnx to suit new API(almost done),
  2. sonnx to use new autograd API,
  3. test cases,
  4. debug test operations,
  5. debug sonnx backend test cases,
  6. examples
  7. add re-training examples
  8. (if time is enough) add more example(will move to another PR)

@lgtm-com
Copy link

lgtm-com bot commented May 18, 2020

This pull request introduces 7 alerts when merging b6a8754 into db1846d - view on LGTM.com

new alerts:

  • 3 for Unused local variable
  • 3 for Unreachable code
  • 1 for Unused import

examples/cnn/onnx/train.py Outdated Show resolved Hide resolved
@lgtm-com
Copy link

lgtm-com bot commented May 18, 2020

This pull request introduces 10 alerts and fixes 13 when merging 7e47512 into db1846d - view on LGTM.com

new alerts:

  • 3 for Unused local variable
  • 3 for Unreachable code
  • 1 for Unnecessary pass
  • 1 for Unused import
  • 1 for Missing call to __init__ during object initialization
  • 1 for Wrong number of arguments in a class instantiation

fixed alerts:

  • 8 for Missing call to __init__ during object initialization
  • 2 for Unreachable code
  • 1 for Unnecessary pass
  • 1 for Unused local variable
  • 1 for Mismatch between signature and use of an overridden method

@lgtm-com
Copy link

lgtm-com bot commented May 18, 2020

This pull request introduces 10 alerts and fixes 13 when merging 5fccbba into db1846d - view on LGTM.com

new alerts:

  • 3 for Unused local variable
  • 3 for Unreachable code
  • 1 for Unnecessary pass
  • 1 for Unused import
  • 1 for Missing call to __init__ during object initialization
  • 1 for Wrong number of arguments in a class instantiation

fixed alerts:

  • 8 for Missing call to __init__ during object initialization
  • 2 for Unreachable code
  • 1 for Unnecessary pass
  • 1 for Unused local variable
  • 1 for Mismatch between signature and use of an overridden method

@lgtm-com
Copy link

lgtm-com bot commented May 19, 2020

This pull request introduces 5 alerts and fixes 1 when merging 8849982 into db1846d - view on LGTM.com

new alerts:

  • 4 for Duplicate key in dict literal
  • 1 for Unused local variable

fixed alerts:

  • 1 for Unused local variable

@lgtm-com
Copy link

lgtm-com bot commented May 21, 2020

This pull request introduces 7 alerts and fixes 1 when merging 54458cb into 84de1af - view on LGTM.com

new alerts:

  • 4 for Duplicate key in dict literal
  • 2 for Unused local variable
  • 1 for Wrong number of arguments in a class instantiation

fixed alerts:

  • 1 for Unused local variable

@lgtm-com
Copy link

lgtm-com bot commented May 22, 2020

This pull request introduces 7 alerts and fixes 1 when merging cfa8878 into 84de1af - view on LGTM.com

new alerts:

  • 4 for Duplicate key in dict literal
  • 2 for Unused local variable
  • 1 for Wrong number of arguments in a class instantiation

fixed alerts:

  • 1 for Unused local variable

@lgtm-com
Copy link

lgtm-com bot commented May 22, 2020

This pull request introduces 7 alerts and fixes 1 when merging 03c28ca into 84de1af - view on LGTM.com

new alerts:

  • 4 for Duplicate key in dict literal
  • 2 for Unused local variable
  • 1 for Wrong number of arguments in a class instantiation

fixed alerts:

  • 1 for Unused local variable

@lgtm-com
Copy link

lgtm-com bot commented May 27, 2020

This pull request introduces 2 alerts and fixes 1 when merging 27051ae into bec1964 - view on LGTM.com

new alerts:

  • 2 for Unused local variable

fixed alerts:

  • 1 for Unused local variable

@lgtm-com
Copy link

lgtm-com bot commented May 28, 2020

This pull request introduces 2 alerts and fixes 1 when merging 70a0d7e into bec1964 - view on LGTM.com

new alerts:

  • 2 for Unused local variable

fixed alerts:

  • 1 for Unused local variable

@lgtm-com
Copy link

lgtm-com bot commented May 29, 2020

This pull request introduces 1 alert and fixes 1 when merging 486e1d6 into bec1964 - view on LGTM.com

new alerts:

  • 1 for Unused local variable

fixed alerts:

  • 1 for Unused local variable

@lgtm-com
Copy link

lgtm-com bot commented May 29, 2020

This pull request introduces 15 alerts and fixes 1 when merging f83b286 into bec1964 - view on LGTM.com

new alerts:

  • 14 for Unused import
  • 1 for Unused local variable

fixed alerts:

  • 1 for Unused local variable

@joddiy joddiy marked this pull request as ready for review May 30, 2020 12:48
@lgtm-com
Copy link

lgtm-com bot commented May 30, 2020

This pull request introduces 11 alerts and fixes 1 when merging 223b9e3 into dd18aff - view on LGTM.com

new alerts:

  • 10 for Unused import
  • 1 for Unused local variable

fixed alerts:

  • 1 for Unused local variable

@lgtm-com
Copy link

lgtm-com bot commented May 30, 2020

This pull request introduces 3 alerts and fixes 1 when merging 7e5bf26 into dd18aff - view on LGTM.com

new alerts:

  • 3 for Unused import

fixed alerts:

  • 1 for Unused local variable

@lgtm-com
Copy link

lgtm-com bot commented May 30, 2020

This pull request fixes 1 alert when merging fb76557 into dd18aff - view on LGTM.com

fixed alerts:

  • 1 for Unused local variable

@lgtm-com
Copy link

lgtm-com bot commented May 31, 2020

This pull request fixes 1 alert when merging 44796e6 into dd18aff - view on LGTM.com

fixed alerts:

  • 1 for Unused local variable

super(SONNXModel, self).__init__()
self.sg_ir = prepare(onnx_model)
for node, operator in self.sg_ir.layers:
self.__dict__[node.name] = operator
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is each operator here a Layer instance?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, you can check the dict of _rename_operators, for the normal operator, it creates the operator from the autograd.py, and for the layer operator, it creates it from layer.py.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if operator is not a Layer instance, then the save_states and load_states cannot work, which works by saving the states of the sub-layers.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At Line 2035-2040, the code will check the type of the instance, if it's from autograd, it will call setattr(op, key, value), otherwise will call op.set_states(**states).

@lgtm-com
Copy link

lgtm-com bot commented Jun 2, 2020

This pull request fixes 1 alert when merging 00b65b2 into dd18aff - view on LGTM.com

fixed alerts:

  • 1 for Unused local variable

@lgtm-com
Copy link

lgtm-com bot commented Jun 2, 2020

This pull request fixes 1 alert when merging e93770b into dd18aff - view on LGTM.com

fixed alerts:

  • 1 for Unused local variable

@lgtm-com
Copy link

lgtm-com bot commented Jun 5, 2020

This pull request fixes 1 alert when merging de46a51 into ede4a3e - view on LGTM.com

fixed alerts:

  • 1 for Unused local variable

@joddiy joddiy force-pushed the sonnx_new_api branch 3 times, most recently from c7b24fc to 61e424e Compare June 5, 2020 10:18
@lgtm-com
Copy link

lgtm-com bot commented Jun 5, 2020

This pull request fixes 1 alert when merging 61e424e into ede4a3e - view on LGTM.com

fixed alerts:

  • 1 for Unused local variable

@joddiy
Copy link
Member Author

joddiy commented Jun 5, 2020

@nudles ready to merge

@lgtm-com
Copy link

lgtm-com bot commented Jun 5, 2020

This pull request fixes 1 alert when merging 6d46112 into ede4a3e - view on LGTM.com

fixed alerts:

  • 1 for Unused local variable

Copy link
Member

@nudles nudles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after we convert onnx model to sonnx model and finish the training, can we save the sonnx model as onnx model?

examples/onnx/arcface.py Outdated Show resolved Hide resolved
@lgtm-com
Copy link

lgtm-com bot commented Jun 5, 2020

This pull request fixes 1 alert when merging c563ed3 into ede4a3e - view on LGTM.com

fixed alerts:

  • 1 for Unused local variable

@lgtm-com
Copy link

lgtm-com bot commented Jun 5, 2020

This pull request fixes 1 alert when merging 6af18ba into ede4a3e - view on LGTM.com

fixed alerts:

  • 1 for Unused local variable

@lgtm-com
Copy link

lgtm-com bot commented Jun 5, 2020

This pull request fixes 1 alert when merging 43addc7 into ede4a3e - view on LGTM.com

fixed alerts:

  • 1 for Unused local variable

@nudles nudles merged commit 038e2df into apache:dev Jun 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants