zhang-tao-whu / e2ec

E2EC: An End-to-End Contour-based Method for High-Quality High-Speed Instance Segmentation
Other
214 stars 45 forks source link

About the batchsize and the missmatch of tensor size #5

Closed AGanPoi closed 2 years ago

AGanPoi commented 2 years ago

Due to my GPU device limit, I change the batchsize from 32 to 8 in cityscapes training, but it got an unexpected error that in the computation of loss, the tensor missmatch the size. I am comfused what's wrong with this error if I lower the batchsize. Or this code only can train cityscapes in batchsize of 32? QQ图片20220426164448

AGanPoi commented 2 years ago

What's more, in sbd training , I also change the batchsize from 24 to 12, but it run very well and get the good results.

zhang-tao-whu commented 2 years ago

Sorry, due to an oversight on my part, the training.dataset in the configs/cityscapesCoco.py and configs/cityscapes.py was wrong. Thanks for the reminder. The bug has been fixed.

AGanPoi commented 2 years ago

已收到 甘伟泽

AGanPoi commented 2 years ago

Sorry, due to an oversight on my part, the training.dataset in the configs/cityscapesCoco.py and configs/cityscapes.py was wrong. Thanks for the reminder. The bug has been fixed.

Thank you for your prompt reply. I change the config but came across another error. It seems like the anno_file is a tuple and not a str, so it can not use the pycocotools. I check the "e2ec/dataset/info.py" that the datainfo: "cityspacesCoco_train.anno_dir" has two str 'data/cityscapes/annotations/train', 'data/cityscapes/annotations/train_val'. So how I can solve this problem? QQ图片20220427093323

zhang-tao-whu commented 2 years ago

Sorry, I checked the config files and found that cityscapes_train should be used for training and cityscapesCoco_val for validation only. Now that I have corrected these errors, you can try it again.

AGanPoi commented 2 years ago

After modify the config and info, I came cross another error. It seems like the data loading problem. In "e2ec/dataset/train/cityscapes.py" line 110 to 111: for instance in instance_polys: polys = [poly.reshape(-1, 2) for poly in instance] The type of instance_polys is a dict, not a tensor to change the shape. QQ图片20220428084808

AGanPoi commented 2 years ago

After modify the config and info, I came cross another error. It seems like the data loading problem. In "e2ec/dataset/train/cityscapes.py" line 110 to 111: for instance in instance_polys: polys = [poly.reshape(-1, 2) for poly in instance] The type of instance_polys is a dict, not a tensor to change the shape. QQ图片20220428084808

For the training of Cityscapes, I have encountered the above problem. By changing the code in "e2ec/dataset/train/cityscapes.py", line 110, from "polys = [poly.reshape(-1, 2) for poly in instance]" to "polys = [np.array(poly['poly']) for poly in instance]", this bug can be fixed. And the training of Cityscapes go well.

zhang-tao-whu commented 2 years ago

Sorry for the late reply. Thank you for the reminder. I fixes the bugs by changing the 102 line of dataset/train/cityscapes.py as instance_polys = [[np.array(comp['poly']) for comp in obj['components']] for obj in anno], and it workes well now.

AGanPoi commented 2 years ago

已收到 甘伟泽

AGanPoi commented 2 years ago

Sorry for the late reply. Thank you for the reminder. I fixes the bugs by changing the 102 line of dataset/train/cityscapes.py as instance_polys = [[np.array(comp['poly']) for comp in obj['components']] for obj in anno], and it workes well now.

I change this code and training the Cityscapes dataset, but I encounter this error. It seems like randomly happen during training process when I tried several times. The error occurs in “e2ec/train/trainer/utils.py". QQ图片20220606105258

zhang-tao-whu commented 2 years ago

This problem is caused by the fact that the input image does not have any instances. Now I fixed the bugs.

AGanPoi commented 2 years ago

This problem is caused by the fact that the input image does not have any instances. Now I fixed the bugs.

It seems like randomly happen that the local variable error. QQ图片20220607162256

zhang-tao-whu commented 2 years ago

Modified line 37 of train/trainer/snake.py, you can try again.

AGanPoi commented 2 years ago

The code runs very well on the Cityscapes dataset and I get the final results. Thank you for your answer! And I wonder when the code for multi component detection will be released?

zhang-tao-whu commented 2 years ago

I'll do it as soon as possible, should be done by the end of the month.

AGanPoi commented 2 years ago

Thank you for your reply!