Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Upsampling: lack of arguments crashes the kernel #8560

Closed
fmcarlucci opened this issue Nov 6, 2017 · 2 comments
Closed

Upsampling: lack of arguments crashes the kernel #8560

fmcarlucci opened this issue Nov 6, 2017 · 2 comments

Comments

@fmcarlucci
Copy link

fmcarlucci commented Nov 6, 2017

Python 2.7, mxnet v '0.11.0'

Very simply, if sym.UpSampling is not called with the appropriate parameters, MxNet crashes without meaningful error messages.

This will crash:
mx.sym.UpSampling(data=body, scale=4, sample_type='bilinear', workspace=workspace)

But this is fine:
mx.sym.UpSampling(data=body, scale=4, num_filter=3, sample_type='bilinear', workspace=workspace)

Difference being that I added the num_filter argument

A full network example

data = mx.sym.Variable(name='data')
body = mx.sym.BatchNorm(data=data, fix_gamma=True, eps=2e-5, momentum=bn_mom, name='deco_bn_data')
body = mx.sym.Convolution(data=body, num_filter=64, kernel=(7, 7), stride=(2,2), pad=(3, 3), 
                          no_bias=True, name="deco_conv0", workspace=workspace)
body = mx.sym.BatchNorm(data=body, fix_gamma=False, eps=2e-5, momentum=bn_mom, name='deco_bn0')
body = mx.sym.LeakyReLU(data=body, act_type="leaky", slope=0.02, name='deco_lrelu0')
body = mx.sym.Pooling(data=body, kernel=(3, 3), stride=(2,2), pad=(1,1), pool_type='max', name='deco_pooling')
body = mx.sym.Convolution(data=body, num_filter=3, kernel=(1, 1), stride=(1,1), pad=(0, 0), 
                          no_bias=True, name="deco_toRGB", workspace=workspace)
body = mx.sym.UpSampling(data=body, scale=4, num_filter=3, sample_type='bilinear', workspace=workspace)
test_net = mx.sym.Convolution(data=body, num_filter=1, kernel=(4, 4), stride=(3,3), pad=(0, 0))
test_net = mx.symbol.FullyConnected(data=test_net, num_hidden=10, name='fc1')
test_net = mx.symbol.SoftmaxOutput(data=test_net, name='softmax')
@fmcarlucci fmcarlucci changed the title Upsampling: lack of arguments crash the kernel Upsampling: lack of arguments crashes the kernel Nov 6, 2017
@szha
Copy link
Member

szha commented Feb 6, 2018

@apache/mxnet-committers: This issue has been inactive for the past 90 days. It has no label and needs triage.

For general "how-to" questions, our user forum (and Chinese version) is a good place to get help.

@zhanghang1989
Copy link
Contributor

@szha This issue can be closed in favor of #9688

import mxnet as mx
x1 = mx.nd.ones(shape=(2,3,4,4))
y1 = mx.nd.contrib.BilinearResize2D(x1, out_height=5, out_width=5)

@szha szha closed this as completed Apr 9, 2018
@szha szha removed the needs triage label Apr 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants