open-mmlab / mmsegmentation

OpenMMLab Semantic Segmentation Toolbox and Benchmark.
https://mmsegmentation.readthedocs.io/en/main/
Apache License 2.0
7.68k stars 2.53k forks source link

RuntimeError: The size of tensor a (3) must match the size of tensor b (6) at non-singleton dimension 0 #3715

Open ZhoumingZhang opened 1 week ago

ZhoumingZhang commented 1 week ago

Traceback (most recent call last): File "C:\Git clone\mmsegmentation\tools\train.py", line 104, in main() File "C:\Git clone\mmsegmentation\tools\train.py", line 100, in main runner.train() File "C:\Users\13785.conda\envs\pytorch\lib\site-packages\mmengine\runner\runner.py", line 1777, in train model = self.train_loop.run() # type: ignore File "C:\Users\13785.conda\envs\pytorch\lib\site-packages\mmengine\runner\loops.py", line 287, in run self.run_iter(data_batch) File "C:\Users\13785.conda\envs\pytorch\lib\site-packages\mmengine\runner\loops.py", line 311, in run_iter outputs = self.runner.model.train_step( File "C:\Users\13785.conda\envs\pytorch\lib\site-packages\mmengine\model\base_model\base_model.py", line 113, in train_step data = self.data_preprocessor(data, True) File "C:\Users\13785.conda\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl return forward_call(*input, **kwargs) File "C:\Git clone\mmsegmentation\mmseg\models\data_preprocessor.py", line 118, in forward inputs = [(_input - self.mean) / self.std for _input in inputs] File "C:\Git clone\mmsegmentation\mmseg\models\data_preprocessor.py", line 118, in inputs = [(_input - self.mean) / self.std for _input in inputs] RuntimeError: The size of tensor a (3) must match the size of tensor b (6) at non-singleton dimension 0

pomelloa commented 4 days ago

Did you use the data transforms called 'PhotoMetricDistortion'? The step may convert color from BGR to HSV, so the data is limited to a(3).