-
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
[Object Detection] Gluoncv SSD support on CPU #2353
Conversation
a7f1766
to
7f2712f
Compare
7ef52f3
to
81bb789
Compare
Now full support for nnvm is ready. For relay, the only issue is flaky compilation probably caused by relay compiler engine: https://discuss.tvm.ai/t/relay-flaky-compilation-behavior/1478 The code is ready to be reviewed now. @tqchen @zhreshold @Laurawly @vinx13 @were Thanks for @were 's support of hybrid script! |
c1a4876
to
fbe61e9
Compare
tutorials/nnvm/deploy_ssd.py
Outdated
@@ -4,22 +4,21 @@ | |||
**Author**: `Yao Wang <https://github.com/kevinthesun>`_ | |||
|
|||
This article is an introductory tutorial to deploy SSD models with TVM. | |||
<<<<<<< HEAD |
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.
unresolved conflict
0b243b8
to
36250a6
Compare
The relay issue has been resolved. |
np_out2[i, j, k] = -1 | ||
|
||
target = "llvm" | ||
ctx = tvm.cpu() |
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.
Expanding target and ctx to for target, ctx in ctx_list():
can make this function look more generalized.
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.
Will it fail in CI if gpu targets haven't been supported yet?
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.
If so, adding if target == 'cuda' : continue
will work.
@@ -46,7 +96,7 @@ def check_device(device): | |||
f(tvm_data, tvm_valid_count, tvm_out) | |||
tvm.testing.assert_allclose(tvm_out.asnumpy(), np_result, rtol=1e-4) | |||
|
|||
for device in ['llvm', 'opencl', 'cuda']: |
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.
Does this one fail with 'opencl' and 'cuda'?
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.
get_valid_counts need to be implemented for gpu targets.
tutorials/nnvm/deploy_ssd.py
Outdated
'ssd_512_mobilenet1_0_coco', | ||
] | ||
|
||
model_name = "ssd_512_resnet50_v1_voc" | ||
dshape = (1, 3, 512, 512) | ||
dtype = "float32" | ||
target = "llvm" | ||
ctx = tvm.cpu() |
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.
Maybe better to use ctx_list to make it more generalized.
8b12d06
to
9bf0c06
Compare
@tqchen I added pip3 install gluoncv to Dockerfile.ci_gpu and Dockerfile.demo_gpu, but still can't import gluoncv. Is anywhere I missed? |
To make sure we cache the image correctly without repetitive rebuilds. The docker image does not rebuild automatically, please send a separate PR to update the docker file, and I will update the docker image. |
81413f2
to
7eb53da
Compare
7eb53da
to
88a7325
Compare
@tqchen Docker image not updated yet? |
Working on the docker now. |
Please check if the new ci error has things to do with this PR |
88a7325
to
1544aab
Compare
I just ran this test 10000 times locally but didn't get any failure. I'll re-trigger the ci to see what's the problem. |
The CI is now green, but please comment on the flaky case, to see if that could due to random-ness and tie (similar to argmax) or it is something that we can ignore |
99556f4
to
d20024c
Compare
Thanks, @kevinthesun @were @vinx13 @Laurawly this is now merged |
This PR refactors vision operators with hybrid script(thanks to @were). Now gluoncv SSD with resnet and mobilenet are supported in nnvm. SSD with vgg are not supported since x86 conv2d_NCHWc doesn't support dilation yet. Two tasks need to be done: