-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[Relay][Frontend] Caffe2 Support #2507
Conversation
Please satisfy the CI
|
with relay.build_config(opt_level=3): | ||
graph, lib, params = relay.build(func, target, params=params) | ||
|
||
ctx = tvm.cpu(0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we use tvm.relay.testing.config.ctx_list
to test it on all supported targets?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ctx comes from ctx_list and I'm going to remove ctx = tvm.cpu(0)
if __name__ == '__main__': | ||
verify_squeezenet1_1() | ||
verify_resnet50() | ||
verify_vgg19() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test methods should start with "test_" so that nosetests can execute them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the review. I fixed them.
@makihiro could you act on the comments? |
Thank you for the comments, and sorry for the late reply. |
locals()['c2_' + model] = importlib.import_module('caffe2.python.models.' + model) | ||
except ImportError: | ||
try: | ||
os.system("python3 -m caffe2.python.models.download -i -f " + model) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't work with python2.
I think no need to write download code. You can use the caffe2 downloader module instead, which downloads models to "~/.caffe2" by default.
from caffe2.python.models.download import ModelDownloader
mf = ModelDownloader()
mf.get_c2_model(model)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the review. I fixed code to use ModelDownloader
if __name__ == '__main__': | ||
test_verify_squeezenet1_1() | ||
test_verify_resnet50() | ||
test_verify_vgg19() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace 'test_verify' with 'test_forward' to be consistent with other frontend tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I renamed functions in a manner similar to other frontend tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
@hlu1 can you also take a quick look? |
I would like to add the tutorial. Please help to review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good to me
* [Relay][Frontend] Add Caffe2 Support * [Relay][Frontend] Add Caffe2 Support (fix unsed import) * [Relay][Frontend] Add Caffe2 Support (fix caffe2 model import) * [Relay][Frontend] Add Caffe2 Support (fix model install and reflect code reviews) * [Relay][Frontend] Add Caffe2 Support (fix caffe2 model import) * [Relay][Frontend] Add Caffe2 Support (fix caffe2 model import) * [Relay][Frontend] Add Caffe2 Support (fix caffe2 model import) * [Relay][Frontend] Add Caffe2 Support (fix caffe2 frontend import) * [Relay][Frontend] Add Caffe2 Support (rename function name in test_forward) * [Relay][Frontend] Add Caffe2 Support (fix caffe2 model import) * [Relay][Frontend] Add Caffe2 Support (fix caffe2 model import) * [Doc] Caffe2 frontend tutorial * [Doc] Caffe2 frontend tutorial * [Doc] Caffe2 frontend tutorial * [Relay][Frontend] Add Caffe2 Support (remove unsed file)
* [Relay][Frontend] Add Caffe2 Support * [Relay][Frontend] Add Caffe2 Support (fix unsed import) * [Relay][Frontend] Add Caffe2 Support (fix caffe2 model import) * [Relay][Frontend] Add Caffe2 Support (fix model install and reflect code reviews) * [Relay][Frontend] Add Caffe2 Support (fix caffe2 model import) * [Relay][Frontend] Add Caffe2 Support (fix caffe2 model import) * [Relay][Frontend] Add Caffe2 Support (fix caffe2 model import) * [Relay][Frontend] Add Caffe2 Support (fix caffe2 frontend import) * [Relay][Frontend] Add Caffe2 Support (rename function name in test_forward) * [Relay][Frontend] Add Caffe2 Support (fix caffe2 model import) * [Relay][Frontend] Add Caffe2 Support (fix caffe2 model import) * [Doc] Caffe2 frontend tutorial * [Doc] Caffe2 frontend tutorial * [Doc] Caffe2 frontend tutorial * [Relay][Frontend] Add Caffe2 Support (remove unsed file)
* [Relay][Frontend] Add Caffe2 Support * [Relay][Frontend] Add Caffe2 Support (fix unsed import) * [Relay][Frontend] Add Caffe2 Support (fix caffe2 model import) * [Relay][Frontend] Add Caffe2 Support (fix model install and reflect code reviews) * [Relay][Frontend] Add Caffe2 Support (fix caffe2 model import) * [Relay][Frontend] Add Caffe2 Support (fix caffe2 model import) * [Relay][Frontend] Add Caffe2 Support (fix caffe2 model import) * [Relay][Frontend] Add Caffe2 Support (fix caffe2 frontend import) * [Relay][Frontend] Add Caffe2 Support (rename function name in test_forward) * [Relay][Frontend] Add Caffe2 Support (fix caffe2 model import) * [Relay][Frontend] Add Caffe2 Support (fix caffe2 model import) * [Doc] Caffe2 frontend tutorial * [Doc] Caffe2 frontend tutorial * [Doc] Caffe2 frontend tutorial * [Relay][Frontend] Add Caffe2 Support (remove unsed file)
* [Relay][Frontend] Add Caffe2 Support * [Relay][Frontend] Add Caffe2 Support (fix unsed import) * [Relay][Frontend] Add Caffe2 Support (fix caffe2 model import) * [Relay][Frontend] Add Caffe2 Support (fix model install and reflect code reviews) * [Relay][Frontend] Add Caffe2 Support (fix caffe2 model import) * [Relay][Frontend] Add Caffe2 Support (fix caffe2 model import) * [Relay][Frontend] Add Caffe2 Support (fix caffe2 model import) * [Relay][Frontend] Add Caffe2 Support (fix caffe2 frontend import) * [Relay][Frontend] Add Caffe2 Support (rename function name in test_forward) * [Relay][Frontend] Add Caffe2 Support (fix caffe2 model import) * [Relay][Frontend] Add Caffe2 Support (fix caffe2 model import) * [Doc] Caffe2 frontend tutorial * [Doc] Caffe2 frontend tutorial * [Doc] Caffe2 frontend tutorial * [Relay][Frontend] Add Caffe2 Support (remove unsed file)
@hlu1 @tqchen @zhreshold @kazum Please help to review.