shengtao96 / CentripetalText

29 stars 6 forks source link

关于PicklingError的问题 #3

Open Jonyond-lin opened 2 years ago

Jonyond-lin commented 2 years ago

您好,我在复现的过程中碰到了如下问题

(CPT) [root@ts-8789b3171f704463b2163b0583223e52-launcher ~/jonyond/CentripetalText-main]# CUDA_VISIBLE_DEVICES=0,1,2,3 python train.py config/ct/ct_r18_tt.py { "model": { "type": "CT", "backbone": { "type": "resnet18", "pretrained": true }, "neck": { "type": "FPEM_v1", "in_channels": [ 64, 128, 256, 512 ], "out_channels": 128 }, "detection_head": { "type": "CT_Head", "in_channels": 512, "hidden_dim": 128, "num_classes": 3, "loss_kernel": { "type": "DiceLoss", "loss_weight": 1.0 }, "loss_loc": { "type": "SmoothL1Loss", "beta": 0.1, "loss_weight": 0.05 } } }, "data": { "batch_size": 16, "train": { "type": "CT_TT", "split": "train", "is_transform": true, "img_size": 640, "short_size": 640, "kernel_scale": 0.7, "read_type": "cv2" }, "test": { "type": "CT_TT", "split": "test", "short_size": 640, "read_type": "cv2" } }, "train_cfg": { "lr": 0.001, "schedule": "polylr", "epoch": 600, "optimizer": "Adam" }, "test_cfg": { "min_score": 0.88, "min_area": 16, "bbox_type": "poly", "result_path": "outputs/submit_tt/" } } Checkpoint path: checkpoints/ct_r18_tt.

Epoch: [1 | 600] Traceback (most recent call last): File "/root/anaconda3/envs/CPT/lib/python3.6/multiprocessing/queues.py", line 234, in _feed obj = _ForkingPickler.dumps(obj) File "/root/anaconda3/envs/CPT/lib/python3.6/multiprocessing/reduction.py", line 51, in dumps cls(buf, protocol).dump(obj) _pickle.PicklingError: Can't pickle <class 'cPolygon.Error'>: import of module 'cPolygon' failed /root/anaconda3/envs/CPT/lib/python3.6/site-packages/torch/nn/functional.py:2539: UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details. "See the documentation of nn.Upsample for details.".format(mode)) /root/anaconda3/envs/CPT/lib/python3.6/site-packages/torch/nn/functional.py:2457: UserWarning: nn.functional.upsample is deprecated. Use nn.functional.interpolate instead. warnings.warn("nn.functional.upsample is deprecated. Use nn.functional.interpolate instead.") (1/78) LR: 0.001000 | Batch: 32.551s | Total: 0min | ETA: 42min | Loss: 1.303 | Loss(kernel/loc): 0.812/0.491 | IoU(text/kernel): 0.893907/0.426699

请问这种情况如何解决呢?cPolygon好像根本没有这个包,我在网上都找不到

shengtao96 commented 2 years ago

请确认是否安装Polygon3。

推荐按照“Recommended environment”中的配置搭建训练环境。

Jonyond-lin commented 2 years ago

请确认是否安装Polygon3。

推荐按照“Recommended environment”中的配置搭建训练环境。

(CPT) [root@ts-8789b3171f704463b2163b0583223e52-launcher ~]# pip install Polygon3 Looking in indexes: http://mirrors.cloud.tencent.com/pypi/simple Requirement already satisfied: Polygon3 in ./anaconda3/envs/CPT/lib/python3.6/site-packages (3.0.9.1) WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv (CPT) [root@ts-8789b3171f704463b2163b0583223e52-launcher ~]# pip install Polygon3 Looking in indexes: http://mirrors.cloud.tencent.com/pypi/simple Requirement already satisfied: Polygon3 in ./anaconda3/envs/CPT/lib/python3.6/site-packages (3.0.9.1)

环境安装基本上是按照Recommended environment来的,但还是输出了 Epoch: [1 | 600] Traceback (most recent call last): File "/root/anaconda3/envs/CPT/lib/python3.6/multiprocessing/queues.py", line 234, in _feed obj = _ForkingPickler.dumps(obj) File "/root/anaconda3/envs/CPT/lib/python3.6/multiprocessing/reduction.py", line 51, in dumps cls(buf, protocol).dump(obj) _pickle.PicklingError: Can't pickle <class 'cPolygon.Error'>: import of module 'cPolygon' failed /root/anaconda3/envs/CPT/lib/python3.6/site-packages/torch/nn/functional.py:2457: UserWarning: nn.functional.upsample is deprecated. Use nn.functional.interpolate instead. warnings.warn("nn.functional.upsample is deprecated. Use nn.functional.interpolate instead.") /root/anaconda3/envs/CPT/lib/python3.6/site-packages/torch/nn/functional.py:2539: UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details. "See the documentation of nn.Upsample for details.".format(mode)) (1/78) LR: 0.001000 | Batch: 21.952s | Total: 0min | ETA: 29min | Loss: 1.303 | Loss(kernel/loc): 0.812/0.491 | IoU(text/kernel): 0.893907/0.426699 并且一直在这这个地方,这个是正常情况吗,还是说训练的时长就是比较久?

guoli188 commented 2 years ago

我也遇到了这个问题,请问解决了吗?谢谢

Jonyond-lin commented 2 years ago

还是没解决,请问您那边解决了吗?