open-mmlab / mmdetection

OpenMMLab Detection Toolbox and Benchmark
https://mmdetection.readthedocs.io
Apache License 2.0
29.43k stars 9.43k forks source link

RuntimeError: Expected 4-dimensional input for 4-dimensional weight [32, 3, 3, 3], but got 5-dimensional input of size [1, 24, 3, 320, 320] instead #8246

Closed baoguomalaoshi closed 2 years ago

baoguomalaoshi commented 2 years ago

I just run command like this: python tools/train.py configs/faster_rcnn/faster_rcnn_r50_fpn_1x_coco.py or python tools/train.py configs/ssd/ssdlite_mobilenetv2_scratch_600e_coco.py and got a traceback as follow Error traceback RuntimeError: Expected 4-dimensional input for 4-dimensional weight [32, 3, 3, 3], but got 5-dimensional input of size [1, 24, 3, 320, 320] instead the error was in the first layer of backbone.The data can't pass down in the first layer.

RangiLyu commented 2 years ago

Did you modify the config or the code? Could you provide more detailed information?

BIGWangYuDong commented 2 years ago

Feel free to re-open this issue if you still meet this problem

huangfuhuijie commented 2 years ago

After a whole afternoon wondering why this happened, and after code check carefully, i still wonder why there is an additional dimension in training data and how this goes wrong suddenly. Until i found command nvidia-smi failed in my machine. After reinstall nvidia driver, everything goes well. check if your nvidia driver and cuda version if you encounter this problem.