ZwwWayne / mmMOT

[ICCV2019] Robust Multi-Modality Multi-Object Tracking
252 stars 25 forks source link

hi,ValueError: Expected more than 1 value per channel when training, got input size [1, 512] #17

Closed Zhongwei-Luo closed 4 years ago

Zhongwei-Luo commented 4 years ago

Ubuntu 18.04 Cuda compilation tools, release 9.0, V9.0.176 pytorch 1.5.0


(mmmot) lzw@resplendent-star:~/resplendent_code/3d_tracking/mmMOT-master$ python -u eval_seq.py --config /home/lzw/resplendent_code/3d_tracking/mmMOT-master/experiments/pp_pv_40e_dualadd_subabs_C/config.yaml --load-path=/home/lzw/resplendent_code/3d_tracking/mmMOT-master/experiments/pp_pv_40e_dualadd_subabs_C/model/pp_pv_40e_dualadd_subabs_C.pth --result-path=/home/lzw/resplendent_code/3d_tracking/mmMOT-master/experiments/pp_pv_40e_dualadd_subabs_C/results --result_sha=eval Fusion Module C: split sigmoid weight gated point, image fusion use Skip Pooling in appearance model use avg in pointnet feat Use minus_abs similarity with fusion module End version V2 by avg NewEndIndicator_v2( (conv0): Sequential( (0): Conv2d(512, 512, kernel_size=(1, 1), stride=(1, 1)) (1): GroupNorm(1, 512, eps=1e-05, affine=True) (2): ReLU(inplace=True) ) (conv1): Sequential( (0): Conv1d(512, 512, kernel_size=(1,), stride=(1,)) (1): GroupNorm(1, 512, eps=1e-05, affine=True) (2): ReLU(inplace=True) (3): Conv1d(512, 128, kernel_size=(1,), stride=(1,)) (4): GroupNorm(1, 128, eps=1e-05, affine=True) (5): ReLU(inplace=True) (6): Conv1d(128, 1, kernel_size=(1,), stride=(1,)) (7): Sigmoid() ) ) => loading checkpoint '/home/lzw/resplendent_code/3d_tracking/mmMOT-master/experiments/pp_pv_40e_dualadd_subabs_C/model/pp_pv_40e_dualadd_subabs_C.pth' Building dataset using dets file ./data/pp_train_dets.pkl Detect [ 16258] cars in [3365/3975] images Add [0] cars in [0/3975] images Building dataset using dets file ./data/pp_val_dets.pkl Detect [ 13170] cars in [3475/3945] images Add [0] cars in [0/3945] images [2020-04-25 19:21:41,270][eval_seq.py][line: 64][ INFO] args: Namespace(config='/home/lzw/resplendent_code/3d_tracking/mmMOT-master/experiments/pp_pv_40e_dualadd_subabs_C/config.yaml', evaluate=False, load_path='/home/lzw/resplendent_code/3d_tracking/mmMOT-master/experiments/pp_pv_40e_dualadd_subabs_C/model/pp_pv_40e_dualadd_subabs_C.pth', memory=False, recover=False, result_path='/home/lzw/resplendent_code/3d_tracking/mmMOT-master/experiments/pp_pv_40e_dualadd_subabs_C/results', result_sha='eval') [2020-04-25 19:21:41,271][eval_seq.py][line: 65][ INFO] config: {'augmentation': {'input_size': 224, 'test_resize': 224}, 'batch_size': 1, 'det_type': '3D', 'dropblock': 0, 'fixed_wd': True, 'gt_det_ratio': 0, 'loss': {'det_loss': 'bce', 'det_ratio': 1.5, 'link_loss': 'l2', 'smooth_ratio': 0, 'trans_last': True, 'trans_ratio': 0.001}, 'lr_scheduler': {'base_lr': 0.0003, 'div_factor': 10.0, 'lr_max': 0.0006, 'max_iter': 134200, 'moms': [0.95, 0.85], 'optim': 'Adam', 'pct_start': 0.4, 'type': 'one_cycle'}, 'model': {'affinity_op': 'minus_abs', 'appear_arch': 'vgg', 'appear_fpn': False, 'appear_len': 512, 'appear_skippool': True, 'end_arch': 'v2', 'end_mode': 'avg', 'neg_threshold': 0.2, 'point_arch': 'v1', 'point_len': 512, 'score_arch': 'branch_cls', 'score_fusion_arch': 'C', 'softmax_mode': 'dual_add', 'test_mode': 2}, 'momentum': 0.9, 'print_freq': 100, 'sample_max_len': 2, 'save_path': '/home/lzw/resplendent_code/3d_tracking/mmMOT-master/experiments/pp_pv_40e_dualadd_subabs_C', 'tracker_type': '3D', 'train_det': './data/pp_train_dets.pkl', 'train_fix_count': 0, 'train_fix_iou': 1, 'train_link': './data/train.txt', 'train_root': './kitti_t_o/training', 'train_source': './kitti_t_o/training/', 'use_dropout': False, 'use_frustum': False, 'use_moving_average': False, 'val_det': './data/pp_val_dets.pkl', 'val_fix_count': 0, 'val_fix_iou': 1, 'val_freq': 3355, 'val_link': './data/val.txt', 'val_root': './kitti_t_o/training', 'val_source': './kitti_t_o/training/', 'weight_decay': 0.01, 'without_reflectivity': True, 'workers': 1} [2020-04-25 19:21:41,271][eval_seq.py][line: 69][ INFO] Evaluation on traing set: [2020-04-25 19:21:41,271][eval_seq.py][line: 89][ INFO] Test: [0/10] Sequence ID: KITTI-0003 Traceback (most recent call last): File "eval_seq.py", line 204, in main() File "eval_seq.py", line 70, in main validate(train_dataset, tracking_module, args.result_sha, part='train') File "eval_seq.py", line 106, in validate seq_loader, tracking_module) File "eval_seq.py", line 153, in validate_seq input[0], det_info, dets, det_split) File "/home/lzw/resplendent_code/3d_tracking/mmMOT-master/tracking_model.py", line 70, in predict det_imgs, det_info, det_split) File "/home/lzw/anaconda3/envs/mmmot/lib/python3.7/site-packages/torch/nn/modules/module.py", line 550, in call result = self.forward(*input, kwargs) File "/home/lzw/resplendent_code/3d_tracking/mmMOT-master/modules/tracking_net.py", line 166, in forward feats, trans = self.feature(dets, det_info) File "/home/lzw/resplendent_code/3d_tracking/mmMOT-master/modules/tracking_net.py", line 139, in feature det_info['points_split'].long().squeeze(0)) File "/home/lzw/anaconda3/envs/mmmot/lib/python3.7/site-packages/torch/nn/modules/module.py", line 550, in call result = self.forward(*input, *kwargs) File "/home/lzw/resplendent_code/3d_tracking/mmMOT-master/modules/point_net.py", line 26, in forward x, trans = self.feat(x, point_split) File "/home/lzw/anaconda3/envs/mmmot/lib/python3.7/site-packages/torch/nn/modules/module.py", line 550, in call result = self.forward(input, kwargs) File "/home/lzw/resplendent_code/3d_tracking/mmMOT-master/modules/point_net.py", line 119, in forward trans1 = self.stn1(x) File "/home/lzw/anaconda3/envs/mmmot/lib/python3.7/site-packages/torch/nn/modules/module.py", line 550, in call result = self.forward(*input, *kwargs) File "/home/lzw/resplendent_code/3d_tracking/mmMOT-master/modules/point_net.py", line 79, in forward x = self.relu(self.fc_bn1(self.fc1(x))) File "/home/lzw/anaconda3/envs/mmmot/lib/python3.7/site-packages/torch/nn/modules/module.py", line 550, in call result = self.forward(input, **kwargs) File "/home/lzw/anaconda3/envs/mmmot/lib/python3.7/site-packages/torch/nn/modules/normalization.py", line 225, in forward input, self.num_groups, self.weight, self.bias, self.eps) File "/home/lzw/anaconda3/envs/mmmot/lib/python3.7/site-packages/torch/nn/functional.py", line 1971, in group_norm

ZwwWayne commented 4 years ago

It seems there is something wrong with your input to the stn, you may print out the shape of the input in the point_net to see what happened.

dogyoonlee commented 4 years ago

I have this error in same line of the code. the input tensor size before linen x=x.view(-1, 1024 // self.reduction) is [1,1024]. and the error occurs at x=self.reslu(self.fc_bn1(self.fc1(x))) How can I sove this problem? my environment is pytorch 1.5.0, cuda10.2, and torchvision is 0.6.0 on python 3.7

ZwwWayne commented 4 years ago

The code is used in Pytorch 1.1 and has not been used in 1.5. So the compatibility is not guaranteed.

dogyoonlee commented 4 years ago

Thanks. After changing the Pytorch version to 1.1, the problem was solved.

Zhongwei-Luo commented 4 years ago

该代码在Pytorch 1.1中使用,而在1.5中未使用。因此,不能保证兼容性。

thanks

jkini commented 3 years ago

Thanks. After changing the Pytorch version to 1.1, the problem was solved.

Is this the environamnet that helped you fix the issue: pytorch 1.1.0, cuda10.2, and torchvision is 0.6.0 on python 3.7

Ri-Bai commented 2 years ago

@resplendent-star .could please give me the more details of the environment. I have a problem in pytorch and tried many times to solve but failed with the following errors: vci-1@vci1:~/BR/fusion/mmMOT-master$ python eval_seq.py 段错误 (核心已转储)

Ri-Bai commented 2 years ago

@resplendent-star this is my environment and have problem with the code .

packages in environment at /home/vci-1/anaconda3/envs/BR_MOT_08:

#

Name Version Build Channel

_libgcc_mutex 0.1 main https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main _openmp_mutex 4.5 1_gnu https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main _pytorch_select 0.2 gpu_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main absl-py 0.14.0 pypi_0 pypi attrs 21.2.0 pypi_0 pypi blas 1.0 mkl https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free ca-certificates 2021.7.5 h06a4308_1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main certifi 2021.5.30 py37h06a4308_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main cffi 1.14.6 py37h400218f_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main cudatoolkit 10.0.130 0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main cudnn 7.6.5 cuda10.0_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main easydict 1.9 pypi_0 pypi flake8 3.9.2 pypi_0 pypi flake8-import-order 0.18.1 pypi_0 pypi future 0.18.2 pypi_0 pypi importlib-metadata 4.8.1 pypi_0 pypi iniconfig 1.1.1 pypi_0 pypi intel-openmp 2021.3.0 h06a4308_3350 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main ld_impl_linux-64 2.35.1 h7274673_9 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main libffi 3.3 he6710b0_2 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main libgcc-ng 9.3.0 h5101ec6_17 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main libgomp 9.3.0 h5101ec6_17 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main libstdcxx-ng 9.3.0 hd4cf53a_17 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main llvmlite 0.37.0 pypi_0 pypi mccabe 0.6.1 pypi_0 pypi mkl 2020.2 256 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main mkl-service 2.3.0 py37he8ac12f_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main mkl_fft 1.3.0 py37h54f3939_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main mkl_random 1.1.1 py37h0573a6f_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main motmetrics 1.2.0 pypi_0 pypi munkres 1.1.4 pypi_0 pypi ncurses 6.2 he6710b0_1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main ninja 1.7.2 0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free numba 0.54.0 pypi_0 pypi numpy 1.19.2 py37h54aff64_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main numpy-base 1.19.2 py37hfa32c7d_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main opencv-python 4.5.3.56 pypi_0 pypi openssl 1.1.1l h7f8727e_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main ortools 9.0.9048 pypi_0 pypi packaging 21.0 pypi_0 pypi pandas 1.3.3 pypi_0 pypi pillow 8.3.2 pypi_0 pypi pip 21.0.1 py37h06a4308_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main pluggy 1.0.0 pypi_0 pypi protobuf 3.18.0 pypi_0 pypi py 1.10.0 pypi_0 pypi py-cpuinfo 8.0.0 pypi_0 pypi pycodestyle 2.7.0 pypi_0 pypi pycparser 2.20 py_2 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main pyflakes 2.3.1 pypi_0 pypi pyparsing 2.4.7 pypi_0 pypi pyproj 3.2.1 pypi_0 pypi pytest 6.2.5 pypi_0 pypi pytest-benchmark 3.4.1 pypi_0 pypi python 3.7.11 h12debd9_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main python-dateutil 2.8.2 pypi_0 pypi pytorch 1.1.0 cuda100py37he554f03_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main pytz 2021.1 pypi_0 pypi pyyaml 5.4.1 pypi_0 pypi readline 8.1 h27cfd23_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main scipy 1.7.1 pypi_0 pypi setuptools 58.0.4 py37h06a4308_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main six 1.16.0 pyhd3eb1b0_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main sqlite 3.36.0 hc218d9a_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main tk 8.6.10 hbc83047_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main toml 0.10.2 pypi_0 pypi torch 1.5.0 pypi_0 pypi torchvision 0.6.0 pypi_0 pypi typing-extensions 3.10.0.2 pypi_0 pypi wheel 0.37.0 pyhd3eb1b0_1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main xmltodict 0.12.0 pypi_0 pypi xz 5.2.5 h7b6447c_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main zipp 3.5.0 pypi_0 pypi zlib 1.2.11 0 ht