Repository navigation
Bilinear mode in topi::nn::upsampling not working #1692
Description
Activity
@KeDengMS
NCHlayout ???
Can you conform the error log ?Yes NCHW layout, but I believe it exists in NHWC as well. The error is from a crash in dereferencing nullptr in here. The problem is that shape is a Mul node with two IntImm as input from the python API, and as_const_int returns nullptr for non-const node.
It seems const folding should be applied, and moreover the bilinear interpolation code path needs to be tested.@KeDengMS a bit confused.
Is the issue about "Layout Not Supported" or "Crash " ?
Can you share complete log or the sample code?
I think it's nothing about Layout, but more for BILINEAR mode. The repro is to change the python test to use BILINEAR mode:
B = topi.nn.upsampling(A, scale, layout=layout, method='BILINEAR'), then you'll find the crash.But the log says NotImplementedError('Layout not supported {} '.format(layout)). What is the "layout" parameter you passed in? It should be "NCHW" or "NHWC".
The repro I show above is from git diff, not the log. The testcase tests both NCHW and NHWC
@KeDengMS I can repro your crash. The fix is to add util.simplify to https://github.com/dmlc/tvm/blob/master/topi/python/topi/nn/upsampling.py#L34
This is equivalent to const folding you mentioned.I can send a PR to fix this and update the upsampling test.
@srkreddy1238 I made a branch to fix this issue here. But some bilinear upsampling tests are failing. Can you have a look?
- added a commit that references this issue
on Sep 12, 2018 - added a commit that references this issue
on Sep 12, 2018 Thanks for the fix!
- added a commit that references this issue
on Dec 27, 2018
To repro, use following changes in test_topi_upsampling.py: