[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.
can we use tvm.relay.testing.config.ctx_list to test it on all supported targets?
There was a problem hiding this comment.
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.
Test methods should start with "test_" so that nosetests can execute them.
There was a problem hiding this comment.
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.
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.
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.
Replace 'test_verify' with 'test_forward' to be consistent with other frontend tests.
There was a problem hiding this comment.
I renamed functions in a manner similar to other frontend tests.
|
@hlu1 can you also take a quick look? |
|
I would like to add the tutorial. Please help to review. |
* [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.