yazhouliu / EUG

2 stars 1 forks source link

issue in running #1

Open bieyl opened 7 months ago

bieyl commented 7 months ago

size mismatch for 0.weight: copying a param with shape torch.Size([256, 678, 3, 3]) from checkpoint, the shape in current model is torch.Size([256, 1062, 3, 3]).

bieyl commented 7 months ago

Hello yazhouliu: There is a bug In my running EUG tiny. ("model/PSPs_OCRs_checkpoint-best.pth")

bellow are my condigs and checkpoints: _C.EXPERIMENT.CONFIG_FILE1 = "mmsegmentation/configs/ocrnet/ocrnet_hr18s_512x1024_40k_cityscapes.py" _C.EXPERIMENT.CONFIG_FILE2 = "mmsegmentation/configs/pspnet/pspnet_r18-d8_512x1024_80k_cityscapes.py"

_C.EXPERIMENT.CHECKPOINT_FILE1 = "CHECKPOINTS/ocrnet_hr18s_4xb2-40k_cityscapes-512x1024_20230227_145026-6c052a14.pth" _C.EXPERIMENT.CHECKPOINT_FILE2 = "CHECKPOINTS/pspnet_r18-d8_512x1024_80k_cityscapes_20201225_021458-09ffa746.pth"

error: Error(s) in loading state_dict for Sequential: size mismatch for 0.weight: copying a param with shape torch.Size([256, 678, 3, 3]) from checkpoint, the shape in current model is torch.Size([256, 1062, 3, 3]).

so can you help me to sovle it?

yazhouLiu-nust commented 7 months ago

Thanks for the information. There are three checkpoints files need to be loaded for _tiny version, PSP_s, OCR_s and fusion model. This error happens for which check points?

bieyl commented 7 months ago

Thanks for your reversion. The needed for tiny_version are bellow: _C.EXPERIMENT.CONFIG_FILE1 = "mmsegmentation/configs/ocrnet/ocrnet_hr18s_512x1024_40k_cityscapes.py" _C.EXPERIMENT.CONFIG_FILE2 = "mmsegmentation/configs/pspnet/pspnet_r18-d8_512x1024_80k_cityscapes.py" _C.EXPERIMENT.CHECKPOINT_FILE1 = "CHECKPOINTS/ocrnet_hr18s_4xb2-40k_cityscapes-512x1024_20230227_145026-6c052a14.pth" _C.EXPERIMENT.CHECKPOINT_FILE2 = "CHECKPOINTS/pspnet_r18-d8_512x1024_80k_cityscapes_20201225_021458-09ffa746.pth" and fusion model : "EUG-main/model/PSPs_OCRs_checkpoint-best.pth"

bieyl commented 7 months ago

Hello ,Is it because the mmsegmentation versions of model and config are different?

bieyl commented 7 months ago

What is your mmsegmentation version? When I use a higher version(mmsegmentation>1.0.0), the following error will be reported: mmseg/models/builder.py", line 46, in build_segmentor assert cfg.get('test_cfg') is None or test_cfg is None, \ AssertionError: test_cfg specified in both outer field and model field

yazhouLiu-nust commented 7 months ago

mmsegmentation 0.24.1 pypi_0 pypi this is our version. Our code is based on JSRNet, so we follow their setups. Can u run JSRNet successfully?

bieyl commented 7 months ago

hello,for mmsegmentation 0.24.1,could you share it to me? for mmsegmentation=0.28.0 issue: assert cfg.get('test_cfg') is None or test_cfg is None, \ AssertionError: test_cfg specified in both outer field and model field for mmsegmentation=2.0.0 issue: File "/data4/EUG-main/net/model.py", line 5, in from mmseg.apis import init_segmentor ImportError: cannot import name 'init_segmentor' from 'mmseg.apis' (/home/lthpc/anaconda3/envs/sam/lib/python3.9/site-packages/mmseg/apis/init.py)

bieyl commented 7 months ago
联想截图_20240329173703
guoguolixxx commented 2 months ago

Hello yazhouliu: There is a bug In my running EUG tiny. ("model/PSPs_OCRs_checkpoint-best.pth")

bellow are my condigs and checkpoints: _C.EXPERIMENT.CONFIG_FILE1 = "mmsegmentation/configs/ocrnet/ocrnet_hr18s_512x1024_40k_cityscapes.py" _C.EXPERIMENT.CONFIG_FILE2 = "mmsegmentation/configs/pspnet/pspnet_r18-d8_512x1024_80k_cityscapes.py"

_C.EXPERIMENT.CHECKPOINT_FILE1 = "CHECKPOINTS/ocrnet_hr18s_4xb2-40k_cityscapes-512x1024_20230227_145026-6c052a14.pth" _C.EXPERIMENT.CHECKPOINT_FILE2 = "CHECKPOINTS/pspnet_r18-d8_512x1024_80k_cityscapes_20201225_021458-09ffa746.pth"

error: Error(s) in loading state_dict for Sequential: size mismatch for 0.weight: copying a param with shape torch.Size([256, 678, 3, 3]) from checkpoint, the shape in current model is torch.Size([256, 1062, 3, 3]).

so can you help me to sovle it?

Hello , have you solved the problem with your writing? If it hasn't been resolved yet, I think I can provide you with some help because I recently encountered the same problem while reproducing the original author's code. After experimentation, I finally found out that it was a version issue. Here is the environment (Linux)on which my code ultimately ran successfully: mmsegmentation : 0.24.1 mmcv_full : 1.4.0 torch: 1.8.0 cuda : 11.1

Use the above environment, find the corresponding checkpoints and config files on the https://github.com/open-mmlab/mmsegmentation/tree/0.x official website, and download them locally,In particular, the version of the branch is 0.x, and then the corresponding download

finally python train.py --model_name eug_base train successfully