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

[DARKNET]RNN Support for darknet #1443

Merged
merged 3 commits into from
Jul 19, 2018
Merged

Conversation

siju-samuel
Copy link
Member

RNN Support for DARKNET frontend is added.
This PR consists of

  • Darknet frontend framework changed to Class, similar to onnx/tensorflow for better maintainability.
  • RNN layer processing of darknet.
  • RNN Tutorial how to run RNN
  • Testcase to check RNN layer output

Thanks for contributing to TVM! Please refer to guideline https://docs.tvm.ai/contribute/ for useful information and tips. After the pull request is submitted, please request code reviews from others in the community.

@siju-samuel
Copy link
Member Author

@PariksheetPinjari909 , @srkreddy1238 @Huyuwei @masahi
Please help to review this PR


target = 'llvm'
shape_dict = {'data': data.shape}
#with nnvm.compiler.build_config(opt_level=2):
Copy link
Contributor

Choose a reason for hiding this comment

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

remove the commented line if not required.

shape_dict = {'data': data.shape}
#with nnvm.compiler.build_config(opt_level=2):
graph, library, params = nnvm.compiler.build(sym, target, shape_dict, dtype, params=params)
######################################################################
Copy link
Contributor

Choose a reason for hiding this comment

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

Correct the comment styles.

######################################################################
# Prepare cfg and weights file
# Pretrained model available
# --------------------------------------------------------------------
Copy link
Contributor

Choose a reason for hiding this comment

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

Doc style corrections.


CFG_NAME = MODEL_NAME + '.cfg'
WEIGHTS_NAME = MODEL_NAME + '.weights'
CFG_URL = 'https://github.com/siju-samuel/darknet/blob/master/cfg/' + \
Copy link
Contributor

Choose a reason for hiding this comment

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

may use dmlc/web-data instead


######################################################################
# Compile the model on NNVM
# --------------------------------------------------------------------
Copy link
Contributor

Choose a reason for hiding this comment

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

doc style corrections

@siju-samuel
Copy link
Member Author

@srkreddy1238 Thanks for the comments. All comments are addressed. Please check again. TIA

CFG_URL = REPO_URL + 'cfg/' + CFG_NAME + '?raw=true'
WEIGHTS_URL = REPO_URL + 'weights/' + WEIGHTS_NAME + '?raw=true'

def _dl_progress(count, block_size, total_size):
Copy link
Contributor

@srkreddy1238 srkreddy1238 Jul 18, 2018

Choose a reason for hiding this comment

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

Tutorial scripts gets exported to docs.tvm.ai (Ex: https://docs.tvm.ai/tutorials/nnvm/get_started.html) .

Hence suggest to simplify the example by using existing methods.
Here we could use glueon download methods instead of rewriting.

with nnvm.compiler.build_config(opt_level=2):
graph, lib, params = nnvm.compiler.build(sym, target, shape_dict, dtype_dict, params)

# Save the json
Copy link
Contributor

Choose a reason for hiding this comment

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

Saving lib already explained in get_started.py. Can leave a doc pointer instead.

@srkreddy1238
Copy link
Contributor

@siju-samuel with above comments LGTM.

Copy link
Contributor

@srkreddy1238 srkreddy1238 left a comment

Choose a reason for hiding this comment

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

@siju-samuel thanks. good to go now.

@siju-samuel
Copy link
Member Author

@srkreddy1238 Thanks for the review.
@tqchen Please help to merge dmlc/web-data#96, This PR the trained models for the example.

Copy link
Contributor

@PariksheetPinjari909 PariksheetPinjari909 left a comment

Choose a reason for hiding this comment

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

LGTM

@tqchen tqchen merged commit bf6d244 into apache:master Jul 19, 2018
@tqchen
Copy link
Member

tqchen commented Jul 19, 2018

Thanks @siju-samuel @srkreddy1238 @PariksheetPinjari909 , this is now merged

tqchen pushed a commit to tqchen/tvm that referenced this pull request Aug 4, 2018
sergei-mironov pushed a commit to sergei-mironov/tvm that referenced this pull request Aug 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants