decisionforce / TPN

[CVPR 2020] Temporal Pyramid Network for Action Recognition
https://decisionforce.github.io/TPN/
Apache License 2.0
394 stars 55 forks source link

The ckpt for `tsm+tpn` is not able to inference. #21

Closed dreamerlin closed 3 years ago

dreamerlin commented 4 years ago

I use this config to train, it work well. but it occur error when using it to test. The error info is here:

  File "/mnt/lustre/linjintao/other/TPN/mmaction/models/recognizers/TSN2D.py", line 151, in forward_test
    x = self.spatial_temporal_module(x)
  File "/mnt/lustre/linjintao/other/TPN/mmaction/models/tenons/spatial_temporal_modules/simple_spatial_module.py", line 24, in forward
    return self.op(input)
  File "/mnt/lustre/linjintao/anaconda3/envs/other/lib/python3.7/site-packages/torch/nn/modules/pooling.py", line 563, in forward
    result = self.forward(*input, **kwargs)
RuntimeError    self.padding, self.ceil_mode, self.count_include_pad)
: invalid argument 2: non-empty 3D or 4D input tensor expected but got: [1 x 2048 x 6 x 8 x 8] at /opt/conda/conda-bld/pytorch_1556653215914/work/aten/src/THCUNN/generic/SpatialAveragePooling.cu:30

After some debugging, I found the dim of the data is 5 ([1 x 1024 x 6 x 8 x 8]), it was not squeezed by this line for the 3rd dim is not 1. but when training, it can be squeezed since the size is [1 x 1024 x 1 x 7 x 7]. What is the correct testing setting?