Skip to content

[Possible Bug] Upsample operation "Padding is not supported" #1284

@lcit

Description

@lcit

I run into an error related to the padding for a convolution + upsample operation. I pad the convolution to obtain an output volume with the same size as the input one and upsample it to twice its size. The issue persist if I set the padding to 0.
The error is raise during the call to up0.configure.

The error:

!!!!!!!!!!!!!!!!!!!!!!!!!!!

ERROR in validate_arguments src/cpu/kernels/CpuScaleKernel.cpp:357: Padding is not supported
!!!!!!!!!!!!!!!!!!!!!!!!!!!

Minimal code extract:

  std::unique_ptr<NEConvolutionLayer>    conv0{};
  arm_compute::NEScale                   up0{};

  const TensorShape src_shape(12, 12, 2);
  src.allocator()->init(TensorInfo(src_shape, 1, DataType::F32));

  const TensorShape weights_shape_conv0(3, 3, 2, 32);
  const TensorShape biases_shape_conv0(32);
  const TensorShape out_shape_conv0(12, 12, 32);

  weights0.allocator()->init(TensorInfo(weights_shape_conv0, 1, DataType::F32));
  biases0.allocator()->init(TensorInfo(biases_shape_conv0, 1, DataType::F32));
  out_conv0.allocator()->init(TensorInfo(out_shape_conv0, 1, DataType::F32));

  const TensorShape out_shape_up0(24, 24, 32);
  out_up0.allocator()->init(TensorInfo(out_shape_up0, 1, DataType::F32));

  conv0->configure(&src, &weights0, &biases0, &out_conv0,
                   PadStrideInfo(1 /* stride_x */, 1 /* stride_y */, 1 /* pad_x */, 1 /* pad_y */));

  up0.configure(&out_conv0, &out_up0, ScaleKernelInfo(InterpolationPolicy::NEAREST_NEIGHBOR, 
                                                     BorderMode::UNDEFINED));

Version and configuration:
v53.0.0
Linux pynq 5.4.0-xilinx-v2020.1 #1 SMP PREEMPT Thu Apr 8 18:22:30 UTC 2021 armv7l armv7l armv7l GNU/Linux

Build:

CXX="${BASE}gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/"
scons -j12 arch=armv7a build=cross_compile os=linux neon=1 opencl=0 multi_isa=0 openmp=0 cppthreads=0 asserts=1 examples=0 benchmark_examples=0 debug=0 validation_tests=1 standalone=0 examples=0 logging=0 compiler_prefix=${CXX} toolchain_prefix= build_dir="build_armv7a_neon_tests_v53.0.0"
g++ neon_issue_test.cpp ../utils/Utils.cpp -o main -I.. -I../include ${LIBS} -larm_compute -larm_compute_graph -lm -O1 -mfpu=neon-vfpv3 -Wall -O1 -mcpu=cortex-a9 -mfloat-abi=hard -ffunction-sections -fdata-sections

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions