Coder Social home page Coder Social logo

wenmuzhou / psenet.pytorch Goto Github PK

View Code? Open in Web Editor NEW
461.0 15.0 136.0 8.12 MB

A pytorch re-implementation of PSENet: Shape Robust Text Detection with Progressive Scale Expansion Network

License: GNU General Public License v3.0

Python 17.40% Makefile 0.05% C++ 82.44% Objective-C 0.02% CMake 0.07% Shell 0.02%
ocr python3 pytorch text-detection

psenet.pytorch's Introduction

Shape Robust Text Detection with Progressive Scale Expansion Network

Requirements

  • pytorch 1.1
  • torchvision 0.3
  • pyclipper
  • opencv3
  • gcc 4.9+

Update

20190401

  1. add author loss, the results are compared in Performance

Download

resnet50 and resnet152 model on icdar 2015:

  1. bauduyun extract code: rxjf

  2. google drive

Data Preparation

follow icdar15 dataset format

img
│   1.jpg
│   2.jpg   
│		...
gt
│   gt_1.txt
│   gt_2.txt
|		...

Train

  1. config the trainroot,testrootin config.py
  2. use following script to run
python3 train.py

Test

eval.py is used to test model on test dataset

  1. config model_path, data_path, gt_path, save_path in eval.py
  2. use following script to test
python3 eval.py

Predict

predict.py is used to inference on single image

  1. config model_path, img_path, gt_path, save_path in predict.py
  2. use following script to predict
python3 predict.py

Performance

only train on ICDAR2015 dataset with single NVIDIA 1080Ti

my implementation with my loss use adam and warm_up

Method Precision (%) Recall (%) F-measure (%) FPS(1080Ti)
PSENet-1s with resnet50 batch 8 81.13 77.03 79.03 1.76
PSENet-2s with resnet50 batch 8 81.36 77.13 79.18 3.55
PSENet-4s with resnet50 batch 8 81.00 76.55 78.71 4.43
PSENet-1s with resnet152 batch 4 85.45 80.06 82.67 1.48
PSENet-2s with resnet152 batch 4 85.42 80.11 82.68 2.56
PSENet-4s with resnet152 batch 4 83.93 79.00 81.39 2.99

my implementation with my loss use adam and MultiStepLR

Method Precision (%) Recall (%) F-measure (%) FPS(1080Ti)
PSENet-1s with resnet50 batch 8 83.39 79.29 81.29 1.76
PSENet-2s with resnet50 batch 8 83.22 79.05 81.08 3.55
PSENet-4s with resnet50 batch 8 82.57 78.23 80.34 4.43
PSENet-1s with resnet152 batch 4 85.33 79.87 82.51 1.48
PSENet-2s with resnet152 batch 4 85.36 79.73 82.45 2.56
PSENet-4s with resnet152 batch 4 83.95 78.86 81.33 2.99

my implementation with author loss use adam and warm_up

Method Precision (%) Recall (%) F-measure (%) FPS(1080Ti)
PSENet-1s with resnet50 batch 8 83.33 77.75 80.44 1.76
PSENet-2s with resnet50 batch 8 83.01 77.66 80.24 3.55
PSENet-4s with resnet50 batch 8 82.38 76.98 79.59 4.43
PSENet-1s with resnet152 batch 4 85.16 79.87 82.43 1.48
PSENet-2s with resnet152 batch 4 85.03 79.63 82.24 2.56
PSENet-4s with resnet152 batch 4 84.53S 79.20 81.77 2.99

my implementation with author loss use adam and MultiStepLR

Method Precision (%) Recall (%) F-measure (%) FPS(1080Ti)
PSENet-1s with resnet50 batch 8 83.93 79.48 81.65 1.76
PSENet-2s with resnet50 batch 8 84.17 79.63 81.84 3.55
PSENet-4s with resnet50 batch 8 83.50 78.71 81.04 4.43
PSENet-1s with resnet152 batch 4 85.16 79.58 82.28 1.48
PSENet-2s with resnet152 batch 4 85.13 79.15 82.03 2.56
PSENet-4s with resnet152 batch 4 84.40 78.71 81.46 2.99

official implementation use SGD and StepLR

Method Precision (%) Recall (%) F-measure (%) FPS(1080Ti)
PSENet-1s with resnet50 batch 8 84.15 80.26 82.16 1.76
PSENet-2s with resnet50 batch 8 83.61 79.82 81.67 3.72
PSENet-4s with resnet50 batch 8 81.90 78.23 80.03 4.51
PSENet-1s with resnet152 batch 4 82.87 78.76 80.77 1.53
PSENet-2s with resnet152 batch 4 82.33 78.33 80.28 2.61
PSENet-4s with resnet152 batch 4 81.19 77.13 79.11 3.00

examples

reference

  1. https://github.com/liuheng92/tensorflow_PSENet
  2. https://github.com/whai362/PSENet

psenet.pytorch's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

psenet.pytorch's Issues

Training to suspend

作者你好,我在ICDAR2015数据集上尝试训练的时候,训练过程中使用测试集进行测试完保存模型后,程序会中止在那。既不继续训练,也不报错。
我尝试在保存完模型再重新加载模型,还是不能继续训练,也不报错。
我对pytorch不是很熟,不知道什么错误,作者能不能给一下指导。

pse compile

How can I compile the pse.so in python 3.5?

模型源文件修改了

您好,我看你最近微调了下模型的结构。那你之前上传的预训练模型还有用吗

Pre-Trained Models

Hello -- are the weights for the pre-trained models the ones available on the struck out links in the readme -- that of ResNet50 and 152.

If not -- where could I download them?

Would be really grateful for any help :D

Thank you!

Traning on tianchi data

Hi,When I use the code to train TianChi Data,It doesn't work.Many errors happened.So have you trained on TianChi Data?Which code should I modify to train TianChi data.Could you give me some advice ? Thank you

eval.py的问题

我在改了路径之后,运行eval.py
出现了这个问题:
image
我运行环境是windows10,torch1.1.0,torchvision0.3.0
想问问这个是什么原因呢?

模型在SCUT-CTW1500数据集上的效果怎么样?

你好,我想请教下这个代码在scut数据集上的效果怎么样,我用这个代码在icdar15数据集上测试过,效果能达到precision:0.8212,recall:0.7694,hmean:0.7944。
有一点不太明白的是论文中提出psenet可以痛过分割检测出任意形状的文字,但是我在看代码中生成mask的时候,是通过边框的四点坐标将原来的边框整个转换为了mask,是否对于scut数据集有不同的处理方式?(或者是大体都是将边框转换为mask的形式)

Scale 调成4之后出现IndexError

File "/media/data/pse2/models/loss.py", line 86, in ohem_single
neg_score = score[gt_text <= 0.5]
IndexError: boolean index did not match indexed array along dimension 0; dimension is 160 but corresponding boolean dimension is 640

请问怎么解决?

精度

根据链接下载的模型eval的精度分别是77 和 78 ,这是正常的吗,比论文低许多呀!

有关loss的问题

没错,又是我,我又来了,千万拜托请回答一下这个问题吧
我拿自己的训练集重新训练,其实也就是icdar2017中文检测数据集重头训练,训练出的loss的结果是这样的,感觉不收敛,这个结果是对的吗?
2019-06-16 14:05:04 INFO train.py: [0/600], [0/741], step: 0, 2.282 samples/sec, batch_loss: 0.6487, batch_loss_c: 0.5890, batch_loss_s: 0.7880, time:35.0638, lr:0.0001 2019-06-16 14:05:25 INFO train.py: [0/600], [10/741], step: 10, 3.978 samples/sec, batch_loss: 0.6959, batch_loss_c: 0.6517, batch_loss_s: 0.7990, time:20.1121, lr:0.0001 2019-06-16 14:05:34 INFO train.py: [0/600], [20/741], step: 20, 8.281 samples/sec, batch_loss: 0.6771, batch_loss_c: 0.6669, batch_loss_s: 0.7009, time:9.6603, lr:0.0001 2019-06-16 14:05:44 INFO train.py: [0/600], [30/741], step: 30, 8.115 samples/sec, batch_loss: 0.4114, batch_loss_c: 0.3713, batch_loss_s: 0.5050, time:9.8582, lr:0.0001 2019-06-16 14:05:54 INFO train.py: [0/600], [40/741], step: 40, 7.940 samples/sec, batch_loss: 0.4913, batch_loss_c: 0.4531, batch_loss_s: 0.5804, time:10.0759, lr:0.0001 2019-06-16 14:06:04 INFO train.py: [0/600], [50/741], step: 50, 8.016 samples/sec, batch_loss: 0.5735, batch_loss_c: 0.5390, batch_loss_s: 0.6541, time:9.9800, lr:0.0001 2019-06-16 14:06:24 INFO train.py: [0/600], [60/741], step: 60, 3.988 samples/sec, batch_loss: 0.5176, batch_loss_c: 0.4866, batch_loss_s: 0.5900, time:20.0616, lr:0.0001 2019-06-16 14:06:34 INFO train.py: [0/600], [70/741], step: 70, 8.212 samples/sec, batch_loss: 0.5106, batch_loss_c: 0.4947, batch_loss_s: 0.5476, time:9.7414, lr:0.0001 2019-06-16 14:06:44 INFO train.py: [0/600], [80/741], step: 80, 8.026 samples/sec, batch_loss: 0.4583, batch_loss_c: 0.4119, batch_loss_s: 0.5665, time:9.9672, lr:0.0001 2019-06-16 14:06:54 INFO train.py: [0/600], [90/741], step: 90, 7.636 samples/sec, batch_loss: 0.5777, batch_loss_c: 0.5524, batch_loss_s: 0.6367, time:10.4768, lr:0.0001 2019-06-16 14:07:05 INFO train.py: [0/600], [100/741], step: 100, 7.858 samples/sec, batch_loss: 0.5616, batch_loss_c: 0.5208, batch_loss_s: 0.6569, time:10.1801, lr:0.0001 2019-06-16 14:07:23 INFO train.py: [0/600], [110/741], step: 110, 4.386 samples/sec, batch_loss: 0.6482, batch_loss_c: 0.6230, batch_loss_s: 0.7070, time:18.2402, lr:0.0001 2019-06-16 14:07:33 INFO train.py: [0/600], [120/741], step: 120, 7.834 samples/sec, batch_loss: 0.6373, batch_loss_c: 0.6169, batch_loss_s: 0.6850, time:10.2115, lr:0.0001 2019-06-16 14:07:43 INFO train.py: [0/600], [130/741], step: 130, 8.250 samples/sec, batch_loss: 0.5493, batch_loss_c: 0.4940, batch_loss_s: 0.6783, time:9.6966, lr:0.0001 2019-06-16 14:07:52 INFO train.py: [0/600], [140/741], step: 140, 8.474 samples/sec, batch_loss: 0.7837, batch_loss_c: 0.7423, batch_loss_s: 0.8801, time:9.4409, lr:0.0001 2019-06-16 14:08:02 INFO train.py: [0/600], [150/741], step: 150, 8.075 samples/sec, batch_loss: 0.7084, batch_loss_c: 0.6462, batch_loss_s: 0.8534, time:9.9073, lr:0.0001 2019-06-16 14:08:21 INFO train.py: [0/600], [160/741], step: 160, 4.259 samples/sec, batch_loss: 0.6689, batch_loss_c: 0.6166, batch_loss_s: 0.7911, time:18.7838, lr:0.0001 2019-06-16 14:08:30 INFO train.py: [0/600], [170/741], step: 170, 8.376 samples/sec, batch_loss: 0.4608, batch_loss_c: 0.4029, batch_loss_s: 0.5959, time:9.5513, lr:0.0001 2019-06-16 14:08:40 INFO train.py: [0/600], [180/741], step: 180, 8.049 samples/sec, batch_loss: 0.5276, batch_loss_c: 0.4842, batch_loss_s: 0.6289, time:9.9389, lr:0.0001 2019-06-16 14:08:50 INFO train.py: [0/600], [190/741], step: 190, 8.038 samples/sec, batch_loss: 0.8508, batch_loss_c: 0.8100, batch_loss_s: 0.9460, time:9.9531, lr:0.0001 2019-06-16 14:09:05 INFO train.py: [0/600], [200/741], step: 200, 5.566 samples/sec, batch_loss: 0.5191, batch_loss_c: 0.4413, batch_loss_s: 0.7007, time:14.3731, lr:0.0001 2019-06-16 14:09:22 INFO train.py: [0/600], [210/741], step: 210, 4.579 samples/sec, batch_loss: 0.6712, batch_loss_c: 0.6369, batch_loss_s: 0.7514, time:17.4727, lr:0.0001 2019-06-16 14:09:32 INFO train.py: [0/600], [220/741], step: 220, 8.443 samples/sec, batch_loss: 0.5468, batch_loss_c: 0.5085, batch_loss_s: 0.6361, time:9.4758, lr:0.0001 2019-06-16 14:09:43 INFO train.py: [0/600], [230/741], step: 230, 7.284 samples/sec, batch_loss: 0.6120, batch_loss_c: 0.5617, batch_loss_s: 0.7295, time:10.9823, lr:0.0001 2019-06-16 14:09:52 INFO train.py: [0/600], [240/741], step: 240, 8.349 samples/sec, batch_loss: 0.6051, batch_loss_c: 0.5453, batch_loss_s: 0.7446, time:9.5820, lr:0.0001 2019-06-16 14:10:02 INFO train.py: [0/600], [250/741], step: 250, 7.841 samples/sec, batch_loss: 0.7247, batch_loss_c: 0.7025, batch_loss_s: 0.7766, time:10.2027, lr:0.0001 2019-06-16 14:10:21 INFO train.py: [0/600], [260/741], step: 260, 4.222 samples/sec, batch_loss: 0.5713, batch_loss_c: 0.5216, batch_loss_s: 0.6870, time:18.9468, lr:0.0001 2019-06-16 14:10:31 INFO train.py: [0/600], [270/741], step: 270, 8.194 samples/sec, batch_loss: 0.4275, batch_loss_c: 0.3918, batch_loss_s: 0.5106, time:9.7634, lr:0.0001 2019-06-16 14:10:41 INFO train.py: [0/600], [280/741], step: 280, 8.335 samples/sec, batch_loss: 0.7334, batch_loss_c: 0.7003, batch_loss_s: 0.8107, time:9.5977, lr:0.0001 2019-06-16 14:10:51 INFO train.py: [0/600], [290/741], step: 290, 7.972 samples/sec, batch_loss: 0.4526, batch_loss_c: 0.3952, batch_loss_s: 0.5863, time:10.0354, lr:0.0001 2019-06-16 14:11:00 INFO train.py: [0/600], [300/741], step: 300, 8.297 samples/sec, batch_loss: 0.6505, batch_loss_c: 0.6269, batch_loss_s: 0.7058, time:9.6419, lr:0.0001 2019-06-16 14:11:18 INFO train.py: [0/600], [310/741], step: 310, 4.493 samples/sec, batch_loss: 0.5410, batch_loss_c: 0.5006, batch_loss_s: 0.6354, time:17.8042, lr:0.0001 2019-06-16 14:11:28 INFO train.py: [0/600], [320/741], step: 320, 8.510 samples/sec, batch_loss: 0.5535, batch_loss_c: 0.4923, batch_loss_s: 0.6962, time:9.4011, lr:0.0001 2019-06-16 14:11:37 INFO train.py: [0/600], [330/741], step: 330, 8.138 samples/sec, batch_loss: 0.5340, batch_loss_c: 0.4953, batch_loss_s: 0.6243, time:9.8307, lr:0.0001 2019-06-16 14:11:47 INFO train.py: [0/600], [340/741], step: 340, 8.378 samples/sec, batch_loss: 0.4422, batch_loss_c: 0.3610, batch_loss_s: 0.6317, time:9.5487, lr:0.0001 2019-06-16 14:11:56 INFO train.py: [0/600], [350/741], step: 350, 8.571 samples/sec, batch_loss: 0.6063, batch_loss_c: 0.5282, batch_loss_s: 0.7885, time:9.3337, lr:0.0001 2019-06-16 14:12:15 INFO train.py: [0/600], [360/741], step: 360, 4.313 samples/sec, batch_loss: 0.6468, batch_loss_c: 0.6375, batch_loss_s: 0.6685, time:18.5492, lr:0.0001 2019-06-16 14:12:24 INFO train.py: [0/600], [370/741], step: 370, 8.555 samples/sec, batch_loss: 0.4454, batch_loss_c: 0.4177, batch_loss_s: 0.5101, time:9.3514, lr:0.0001 2019-06-16 14:12:35 INFO train.py: [0/600], [380/741], step: 380, 7.531 samples/sec, batch_loss: 0.6706, batch_loss_c: 0.6109, batch_loss_s: 0.8099, time:10.6232, lr:0.0001 2019-06-16 14:12:45 INFO train.py: [0/600], [390/741], step: 390, 7.875 samples/sec, batch_loss: 0.5807, batch_loss_c: 0.5188, batch_loss_s: 0.7251, time:10.1590, lr:0.0001 2019-06-16 14:12:58 INFO train.py: [0/600], [400/741], step: 400, 6.320 samples/sec, batch_loss: 0.5686, batch_loss_c: 0.5284, batch_loss_s: 0.6623, time:12.6579, lr:0.0001

点赞

又看见你了,你也太强了把,先点赞留个位,以后多多来请教

pan.baidu download

Please can you make the following files available on onedrive or google drive, it is difficult for non-chinese users to download

resnet50 and resnet152 model on icdar 2015: bauduyun extract code: rxjf

数据预处理

现在这个数据预处理是参考east的,所以剪裁的时候是选择部分纯背景部分含文字且不会从中间切开,作者是都处理成label图像,然后和原图一起随机剪裁变化,如果训练数据含密集文本,用这个方法比较好

The training stops when reaching [test models]

@WenmuZhou
I am training a model on icdar2015, when my training reaches test models it stops with an error.
My issue seems similar to #3 , I even tested setting the workers = 0 but still not working

My log:

(final) home@home-desktop:~/p3/PSENet.pytorch-master$ python train.py
make: Entering directory '/home/home/p3/PSENet.pytorch-master/pse'
make: 'pse.so' is up to date.
make: Leaving directory '/home/home/p3/PSENet.pytorch-master/pse'
2019-10-13 05:40:52 INFO      utils.py: logger init finished
2019-10-13 05:40:52 INFO      train.py: {'Lambda': 0.7,
 'OHEM_ratio': 3,
 'backbone': 'resnet152',
 'checkpoint': './check/resnet152.pth',
 'data_shape': 640,
 'display_input_images': False,
 'display_interval': 10,
 'display_output_images': False,
 'end_lr': 1e-07,
 'epochs': 100,
 'gpu_id': '0',
 'lr': 0.0001,
 'lr_decay_step': [200, 400],
 'lr_gamma': 0.1,
 'm': 0.5,
 'n': 6,
 'output_dir': './output/psenet_icd2015',
 'pretrained': True,
 'restart_training': True,
 'scale': 1,
 'seed': 2,
 'show_images_interval': 50,
 'start_epoch': 0,
 'testroot': './data/test',
 'train_batch_size': 1,
 'trainroot': './data/train',
 'warm_up_epoch': 6,
 'warm_up_lr': 1e-05,
 'weight_decay': 0.0005,
 'workers': 1}
2019-10-13 05:40:52 INFO      train.py: train with gpu 0 and pytorch 1.2.0
2019-10-13 05:40:53 INFO      resnet.py: load pretrained models from imagenet
2019-10-13 05:40:55 INFO      train.py: train dataset has 11 samples,11 in dataloader
/home/home/anaconda3/envs/final/lib/python3.6/site-packages/torch/optim/lr_scheduler.py:82: UserWarning: Detected call of `lr_scheduler.step()` before `optimizer.step()`. In PyTorch 1.1.0 and later, you should call them in the opposite order: `optimizer.step()` before `lr_scheduler.step()`.  Failure to do this will result in PyTorch skipping the first value of the learning rate schedule.See more details at https://pytorch.org/docs/stable/optim.html#how-to-adjust-learning-rate
  "https://pytorch.org/docs/stable/optim.html#how-to-adjust-learning-rate", UserWarning)
2019-10-13 05:40:59 INFO      train.py: [0/100], [0/11], step: 0, 2.350 samples/sec, batch_loss: 0.6994, batch_loss_c: 0.5991, batch_loss_s: 0.9336, time:4.2546, lr:0.0001
2019-10-13 05:41:02 INFO      train.py: [0/100], [10/11], step: 10, 3.261 samples/sec, batch_loss: 0.4831, batch_loss_c: 0.4424, batch_loss_s: 0.5779, time:3.0670, lr:0.0001
2019-10-13 05:41:02 INFO      train.py: [0/100], train_loss: 0.6902, time: 7.3495, lr: 0.0001
2019-10-13 05:41:03 INFO      train.py: [1/100], [0/11], step: 11, 26.996 samples/sec, batch_loss: 0.6069, batch_loss_c: 0.5748, batch_loss_s: 0.6820, time:0.3704, lr:0.0001
2019-10-13 05:41:06 INFO      train.py: [1/100], [10/11], step: 21, 3.251 samples/sec, batch_loss: 0.6404, batch_loss_c: 0.5976, batch_loss_s: 0.7404, time:3.0759, lr:0.0001
2019-10-13 05:41:06 INFO      train.py: [1/100], train_loss: 0.6874, time: 3.4756, lr: 0.0001
2019-10-13 05:41:06 INFO      train.py: [2/100], [0/11], step: 22, 26.784 samples/sec, batch_loss: 1.0000, batch_loss_c: 1.0000, batch_loss_s: 1.0000, time:0.3734, lr:0.0001
2019-10-13 05:41:09 INFO      train.py: [2/100], [10/11], step: 32, 3.265 samples/sec, batch_loss: 0.2357, batch_loss_c: 0.2217, batch_loss_s: 0.2685, time:3.0630, lr:0.0001
2019-10-13 05:41:09 INFO      train.py: [2/100], train_loss: 0.5731, time: 3.4645, lr: 0.0001
2019-10-13 05:41:10 INFO      train.py: [3/100], [0/11], step: 33, 25.340 samples/sec, batch_loss: 0.7164, batch_loss_c: 0.6033, batch_loss_s: 0.9805, time:0.3946, lr:0.0001
2019-10-13 05:41:13 INFO      train.py: [3/100], [10/11], step: 43, 3.206 samples/sec, batch_loss: 0.4401, batch_loss_c: 0.4349, batch_loss_s: 0.4524, time:3.1190, lr:0.0001
2019-10-13 05:41:13 INFO      train.py: [3/100], train_loss: 0.5325, time: 3.5407, lr: 0.0001
2019-10-13 05:41:13 INFO      train.py: [4/100], [0/11], step: 44, 28.332 samples/sec, batch_loss: 1.0000, batch_loss_c: 1.0000, batch_loss_s: 1.0000, time:0.3530, lr:0.0001
2019-10-13 05:41:16 INFO      train.py: [4/100], [10/11], step: 54, 3.305 samples/sec, batch_loss: 1.0000, batch_loss_c: 1.0000, batch_loss_s: 1.0000, time:3.0259, lr:0.0001
2019-10-13 05:41:16 INFO      train.py: [4/100], train_loss: 0.6342, time: 3.4067, lr: 0.0001
2019-10-13 05:41:17 INFO      train.py: [5/100], [0/11], step: 55, 25.383 samples/sec, batch_loss: 0.6059, batch_loss_c: 0.5762, batch_loss_s: 0.6752, time:0.3940, lr:0.0001
2019-10-13 05:41:20 INFO      train.py: [5/100], [10/11], step: 65, 3.271 samples/sec, batch_loss: 0.2993, batch_loss_c: 0.3713, batch_loss_s: 0.1312, time:3.0569, lr:0.0001
2019-10-13 05:41:20 INFO      train.py: [5/100], train_loss: 0.5481, time: 3.4813, lr: 0.0001
2019-10-13 05:41:20 INFO      train.py: [6/100], [0/11], step: 66, 26.413 samples/sec, batch_loss: 0.4229, batch_loss_c: 0.4252, batch_loss_s: 0.4177, time:0.3786, lr:0.0001
2019-10-13 05:41:23 INFO      train.py: [6/100], [10/11], step: 76, 3.291 samples/sec, batch_loss: 1.0000, batch_loss_c: 1.0000, batch_loss_s: 1.0000, time:3.0382, lr:0.0001
2019-10-13 05:41:23 INFO      train.py: [6/100], train_loss: 0.5335, time: 3.4410, lr: 0.0001
2019-10-13 05:41:24 INFO      train.py: [7/100], [0/11], step: 77, 25.149 samples/sec, batch_loss: 0.4964, batch_loss_c: 0.4870, batch_loss_s: 0.5182, time:0.3976, lr:0.0001
2019-10-13 05:41:27 INFO      train.py: [7/100], [10/11], step: 87, 3.243 samples/sec, batch_loss: 0.1617, batch_loss_c: 0.1442, batch_loss_s: 0.2023, time:3.0839, lr:0.0001
2019-10-13 05:41:27 INFO      train.py: [7/100], train_loss: 0.5238, time: 3.5103, lr: 0.0001
2019-10-13 05:41:27 INFO      train.py: [8/100], [0/11], step: 88, 25.768 samples/sec, batch_loss: 0.3041, batch_loss_c: 0.3034, batch_loss_s: 0.3055, time:0.3881, lr:0.0001
2019-10-13 05:41:30 INFO      train.py: [8/100], [10/11], step: 98, 3.163 samples/sec, batch_loss: 0.4755, batch_loss_c: 0.4429, batch_loss_s: 0.5517, time:3.1618, lr:0.0001
2019-10-13 05:41:30 INFO      train.py: [8/100], train_loss: 0.5797, time: 3.5803, lr: 0.0001
2019-10-13 05:41:31 INFO      train.py: [9/100], [0/11], step: 99, 24.169 samples/sec, batch_loss: 0.5055, batch_loss_c: 0.4494, batch_loss_s: 0.6363, time:0.4138, lr:0.0001
2019-10-13 05:41:34 INFO      train.py: [9/100], [10/11], step: 109, 3.247 samples/sec, batch_loss: 1.0000, batch_loss_c: 1.0000, batch_loss_s: 1.0000, time:3.0795, lr:0.0001
2019-10-13 05:41:34 INFO      train.py: [9/100], train_loss: 0.5373, time: 3.5255, lr: 0.0001
2019-10-13 05:41:34 INFO      train.py: [10/100], [0/11], step: 110, 26.647 samples/sec, batch_loss: 0.6993, batch_loss_c: 0.6000, batch_loss_s: 0.9310, time:0.3753, lr:0.0001
2019-10-13 05:41:37 INFO      train.py: [10/100], [10/11], step: 120, 3.249 samples/sec, batch_loss: 0.3659, batch_loss_c: 0.3854, batch_loss_s: 0.3204, time:3.0781, lr:0.0001
2019-10-13 05:41:37 INFO      train.py: [10/100], train_loss: 0.5155, time: 3.4844, lr: 0.0001
2019-10-13 05:41:38 INFO      train.py: [11/100], [0/11], step: 121, 25.979 samples/sec, batch_loss: 0.4168, batch_loss_c: 0.4013, batch_loss_s: 0.4530, time:0.3849, lr:0.0001
2019-10-13 05:41:41 INFO      train.py: [11/100], [10/11], step: 131, 3.232 samples/sec, batch_loss: 0.3028, batch_loss_c: 0.3422, batch_loss_s: 0.2109, time:3.0945, lr:0.0001
2019-10-13 05:41:41 INFO      train.py: [11/100], train_loss: 0.5639, time: 3.5070, lr: 0.0001
2019-10-13 05:41:41 INFO      train.py: [12/100], [0/11], step: 132, 26.902 samples/sec, batch_loss: 0.4069, batch_loss_c: 0.3942, batch_loss_s: 0.4366, time:0.3717, lr:0.0001
2019-10-13 05:41:44 INFO      train.py: [12/100], [10/11], step: 142, 3.277 samples/sec, batch_loss: 0.2912, batch_loss_c: 0.2794, batch_loss_s: 0.3188, time:3.0514, lr:0.0001
2019-10-13 05:41:44 INFO      train.py: [12/100], train_loss: 0.5980, time: 3.4518, lr: 0.0001
2019-10-13 05:41:45 INFO      train.py: [13/100], [0/11], step: 143, 27.316 samples/sec, batch_loss: 1.0000, batch_loss_c: 1.0000, batch_loss_s: 1.0000, time:0.3661, lr:0.0001
2019-10-13 05:41:48 INFO      train.py: [13/100], [10/11], step: 153, 3.220 samples/sec, batch_loss: 0.4055, batch_loss_c: 0.3516, batch_loss_s: 0.5311, time:3.1051, lr:0.0001
2019-10-13 05:41:48 INFO      train.py: [13/100], train_loss: 0.6170, time: 3.5002, lr: 0.0001
2019-10-13 05:41:48 INFO      train.py: [14/100], [0/11], step: 154, 25.028 samples/sec, batch_loss: 0.1432, batch_loss_c: 0.1314, batch_loss_s: 0.1708, time:0.3996, lr:0.0001
2019-10-13 05:41:51 INFO      train.py: [14/100], [10/11], step: 164, 3.258 samples/sec, batch_loss: 1.0000, batch_loss_c: 1.0000, batch_loss_s: 1.0000, time:3.0694, lr:0.0001
2019-10-13 05:41:51 INFO      train.py: [14/100], train_loss: 0.5414, time: 3.4995, lr: 0.0001
2019-10-13 05:41:52 INFO      train.py: [15/100], [0/11], step: 165, 26.693 samples/sec, batch_loss: 0.3728, batch_loss_c: 0.3654, batch_loss_s: 0.3899, time:0.3746, lr:0.0001
2019-10-13 05:41:55 INFO      train.py: [15/100], [10/11], step: 175, 3.256 samples/sec, batch_loss: 0.1322, batch_loss_c: 0.1449, batch_loss_s: 0.1027, time:3.0710, lr:0.0001
2019-10-13 05:41:55 INFO      train.py: [15/100], train_loss: 0.5539, time: 3.4723, lr: 0.0001
2019-10-13 05:41:55 INFO      train.py: [16/100], [0/11], step: 176, 26.328 samples/sec, batch_loss: 0.3516, batch_loss_c: 0.3627, batch_loss_s: 0.3256, time:0.3798, lr:0.0001
2019-10-13 05:41:58 INFO      train.py: [16/100], [10/11], step: 186, 3.234 samples/sec, batch_loss: 0.7073, batch_loss_c: 0.6000, batch_loss_s: 0.9577, time:3.0917, lr:0.0001
2019-10-13 05:41:58 INFO      train.py: [16/100], train_loss: 0.4249, time: 3.5084, lr: 0.0001
2019-10-13 05:41:59 INFO      train.py: [17/100], [0/11], step: 187, 26.359 samples/sec, batch_loss: 0.2356, batch_loss_c: 0.2157, batch_loss_s: 0.2819, time:0.3794, lr:0.0001
2019-10-13 05:42:02 INFO      train.py: [17/100], [10/11], step: 197, 3.211 samples/sec, batch_loss: 0.2067, batch_loss_c: 0.2152, batch_loss_s: 0.1871, time:3.1142, lr:0.0001
2019-10-13 05:42:02 INFO      train.py: [17/100], train_loss: 0.4031, time: 3.5223, lr: 0.0001
2019-10-13 05:42:02 INFO      train.py: [18/100], [0/11], step: 198, 24.509 samples/sec, batch_loss: 0.2297, batch_loss_c: 0.2136, batch_loss_s: 0.2674, time:0.4080, lr:0.0001
2019-10-13 05:42:05 INFO      train.py: [18/100], [10/11], step: 208, 3.176 samples/sec, batch_loss: 1.0000, batch_loss_c: 1.0000, batch_loss_s: 1.0000, time:3.1490, lr:0.0001
2019-10-13 05:42:05 INFO      train.py: [18/100], train_loss: 0.4457, time: 3.5896, lr: 0.0001
2019-10-13 05:42:06 INFO      train.py: [19/100], [0/11], step: 209, 25.056 samples/sec, batch_loss: 0.2912, batch_loss_c: 0.2686, batch_loss_s: 0.3438, time:0.3991, lr:0.0001
2019-10-13 05:42:09 INFO      train.py: [19/100], [10/11], step: 219, 3.235 samples/sec, batch_loss: 0.2599, batch_loss_c: 0.1941, batch_loss_s: 0.4135, time:3.0916, lr:0.0001
2019-10-13 05:42:09 INFO      train.py: [19/100], train_loss: 0.4395, time: 3.5204, lr: 0.0001
2019-10-13 05:42:09 INFO      train.py: [20/100], [0/11], step: 220, 25.007 samples/sec, batch_loss: 0.2725, batch_loss_c: 0.2591, batch_loss_s: 0.3039, time:0.3999, lr:0.0001
2019-10-13 05:42:12 INFO      train.py: [20/100], [10/11], step: 230, 3.239 samples/sec, batch_loss: 1.0000, batch_loss_c: 1.0000, batch_loss_s: 1.0000, time:3.0872, lr:0.0001
2019-10-13 05:42:12 INFO      train.py: [20/100], train_loss: 0.5304, time: 3.5196, lr: 0.0001
2019-10-13 05:42:13 INFO      train.py: [21/100], [0/11], step: 231, 24.451 samples/sec, batch_loss: 0.5386, batch_loss_c: 0.5582, batch_loss_s: 0.4929, time:0.4090, lr:0.0001
2019-10-13 05:42:16 INFO      train.py: [21/100], [10/11], step: 241, 3.260 samples/sec, batch_loss: 1.0000, batch_loss_c: 1.0000, batch_loss_s: 1.0000, time:3.0675, lr:0.0001
2019-10-13 05:42:16 INFO      train.py: [21/100], train_loss: 0.5384, time: 3.5078, lr: 0.0001
2019-10-13 05:42:16 INFO      train.py: [22/100], [0/11], step: 242, 25.894 samples/sec, batch_loss: 0.6823, batch_loss_c: 0.5979, batch_loss_s: 0.8792, time:0.3862, lr:0.0001
2019-10-13 05:42:19 INFO      train.py: [22/100], [10/11], step: 252, 3.227 samples/sec, batch_loss: 1.0000, batch_loss_c: 1.0000, batch_loss_s: 1.0000, time:3.0992, lr:0.0001
2019-10-13 05:42:19 INFO      train.py: [22/100], train_loss: 0.4688, time: 3.5151, lr: 0.0001
2019-10-13 05:42:20 INFO      train.py: [23/100], [0/11], step: 253, 26.003 samples/sec, batch_loss: 0.1498, batch_loss_c: 0.1327, batch_loss_s: 0.1896, time:0.3846, lr:0.0001
2019-10-13 05:42:23 INFO      train.py: [23/100], [10/11], step: 263, 3.167 samples/sec, batch_loss: 0.1623, batch_loss_c: 0.1491, batch_loss_s: 0.1930, time:3.1578, lr:0.0001
2019-10-13 05:42:23 INFO      train.py: [23/100], train_loss: 0.2373, time: 3.5653, lr: 0.0001
test models: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 11/11 [00:12<00:00,  1.11it/s]
Traceback (most recent call last):
  File "/home/home/p3/PSENet.pytorch-master/cal_recall/rrc_evaluation_funcs.py", line 326, in main_evaluation
    evalData = evaluate_method_fn(p['g'], p['s'], evalParams)
  File "/home/home/p3/PSENet.pytorch-master/cal_recall/script.py", line 180, in evaluate_method
    True, False)
  File "/home/home/p3/PSENet.pytorch-master/cal_recall/rrc_evaluation_funcs.py", line 296, in get_tl_line_values_from_file_contents
    points, confidence, transcription = get_tl_line_values(line,LTRB,withTranscription,withConfidence,imWidth,imHeight);
  File "/home/home/p3/PSENet.pytorch-master/cal_recall/rrc_evaluation_funcs.py", line 218, in get_tl_line_values
    raise Exception("Format incorrect. Should be: x1,y1,x2,y2,x3,y3,x4,y4,transcription")
Exception: Format incorrect. Should be: x1,y1,x2,y2,x3,y3,x4,y4,transcription
Traceback (most recent call last):
  File "train.py", line 263, in <module>
    main()
  File "train.py", line 217, in main
    recall, precision, f1 = eval(model, os.path.join(config.output_dir, 'output'), config.testroot, device)
  File "train.py", line 149, in eval
    return result_dict['recall'], result_dict['precision'], result_dict['hmean']
TypeError: string indices must be integers

long_size的设置

当long_size设置到2200+时速度慢,但是设置小一点的时候出现检测框往上飘的情况,请问有什么指点吗?

About prediction

I find that the pseNet may segment a long text into several segments.
could you advise that how to adjust the pse parameters to alleviate the problem.
Thanks a lot.

initial lr rate

how do decide the initial lr rate? why set 1e-4 not 1e-3?

TypeError: string indices must be integers

Traceback (most recent call last):
File "/home1/zy/YY/STR/PSENet.pytorch/cal_recall/rrc_evaluation_funcs.py", line 326, in main_evaluation
evalData = evaluate_method_fn(p['g'], p['s'], evalParams)
File "/home1/zy/YY/STR/PSENet.pytorch/cal_recall/script.py", line 136, in evaluate_method
subm = rrc_evaluation_funcs.load_folder_file(submFilePath, evaluationParams['DET_SAMPLE_NAME_2_ID'], True)
File "/home1/zy/YY/STR/PSENet.pytorch/cal_recall/rrc_evaluation_funcs.py", line 102, in load_folder_file
raise Exception('ZIP entry not valid: %s' % name)
Exception: ZIP entry not valid: res_img_269.txt
Traceback (most recent call last):
File "train.py", line 243, in
main()
File "train.py", line 214, in main
recall, precision, f1 = eval(model, os.path.join(config.output_dir, 'output'), config.testroot, device)
File "train.py", line 145, in eval
return result_dict['recall'], result_dict['precision'], result_dict['hmean']
TypeError: string indices must be integers

评价指标

你好,你的eval用的评价指标是ICDAR19的方法么?还是13的

Adam+MultiStepLR

Adam本身不就自带衰减效果吗,现在添加了MultiStepLR,貌似是屏蔽了Adam自带的衰减效果,然后设置几个阈值,达到一个阈值,lr = lr * gamma,可是这样有必要吗,为什么效果会优于Adam自身的衰减效果,查了好多资料也没搞明白个中关系,求大佬明示~

多GPU有问题?

经过实际测试,单GPU inference和train都没问题,多个GPU训练和实现的结果是花的。请问是啥问题?

训练脚本是不是有问题?

2019-07-19 02:41:13 INFO train.py: [0/600], [270/2174], step: 270, 4.418 samples/sec, batch_loss: 1.0000, batch_loss_c: 1.0000, batch_loss_s: 1.0000, time:9.0540, lr:0.0001
2019-07-19 02:41:23 INFO train.py: [0/600], [280/2174], step: 280, 4.098 samples/sec, batch_loss: 1.0000, batch_loss_c: 1.0000, batch_loss_s: 1.0000, time:9.7616, lr:0.0001
2019-07-19 02:41:33 INFO train.py: [0/600], [290/2174], step: 290, 3.949 samples/sec, batch_loss: 1.0000, batch_loss_c: 1.0000, batch_loss_s: 1.0000, time:10.1288, lr:0.0001
2019-07-19 02:41:44 INFO train.py: [0/600], [300/2174], step: 300, 3.925 samples/sec, batch_loss: 1.0000, batch_loss_c: 1.0000, batch_loss_s: 1.0000, time:10.1909, lr:0.0001
2019-07-19 02:41:57 INFO train.py: [0/600], [310/2174], step: 310, 3.010 samples/sec, batch_loss: 1.0000, batch_loss_c: 1.0000, batch_loss_s: 1.0000, time:13.2902, lr:0.0001
2019-07-19 02:42:06 INFO train.py: [0/600], [320/2174], step: 320, 4.557 samples/sec, batch_loss: 1.0000, batch_loss_c: 1.0000, batch_loss_s: 1.0000, time:8.7781, lr:0.0001
2019-07-19 02:42:15 INFO train.py: [0/600], [330/2174], step: 330, 4.236 samples/sec, batch_loss: 1.0000, batch_loss_c: 1.0000, batch_loss_s: 1.0000, time:9.4418, lr:0.0001
2019-07-19 02:42:25 INFO train.py: [0/600], [340/2174], step: 340, 4.078 samples/sec, batch_loss: 1.0000, batch_loss_c: 1.0000, batch_loss_s: 1.0000, time:9.8098, lr:0.0001
2019-07-19 02:42:34 INFO train.py: [0/600], [350/2174], step: 350, 4.388 samples/sec, batch_loss: 1.0000, batch_loss_c: 1.0000, batch_loss_s: 1.0000, time:9.1167, lr:0.0001
2019-07-19 02:42:47 INFO train.py: [0/600], [360/2174], step: 360, 3.192 samples/sec, batch_loss: 1.0000, batch_loss_c: 1.0000, batch_loss_s: 1.0000, time:12.5330, lr:0.0001
2019-07-19 02:42:55 INFO train.py: [0/600], [370/2174], step: 370, 4.602 samples/sec, batch_loss: 1.0000, batch_loss_c: 1.0000, batch_loss_s: 1.0000, time:8.6921, lr:0.0001
2019-07-19 02:43:04 INFO train.py: [0/600], [380/2174], step: 380, 4.430 samples/sec, batch_loss: 1.0000, batch_loss_c: 1.0000, batch_loss_s: 1.0000, time:9.0293, lr:0.0001
2019-07-19 02:43:13 INFO train.py: [0/600], [390/2174], step: 390, 4.344 samples/sec, batch_loss: 1.0000, batch_loss_c: 1.0000, batch_loss_s: 1.0000, time:9.2083, lr:0.0001
2019-07-19 02:43:23 INFO train.py: [0/600], [400/2174], step: 400, 4.335 samples/sec, batch_loss: 1.0000, batch_loss_c: 1.0000, batch_loss_s: 1.0000, time:9.2282, lr:0.0001
2019-07-19 02:43:35 INFO train.py: [0/600], [410/2174], step: 410, 3.228 samples/sec, batch_loss: 1.0000, batch_loss_c: 1.0000, batch_loss_s: 1.0000, time:12.3918, lr:0.0001
2019-07-19 02:43:44 INFO train.py: [0/600], [420/2174], step: 420, 4.295 samples/sec, batch_loss: 1.0000, batch_loss_c: 1.0000, batch_loss_s: 1.0000, time:9.3133, lr:0.0001
2019-07-19 02:43:53 INFO train.py: [0/600], [430/2174], step: 430, 4.535 samples/sec, batch_loss: 1.0000, batch_loss_c: 1.0000, batch_loss_s: 1.0000, time:8.8202, lr:0.0001
2019-07-19 02:44:02 INFO train.py: [0/600], [440/2174], step: 440, 4.388 samples/sec, batch_loss: 1.0000, batch_loss_c: 1.0000, batch_loss_s: 1.0000, time:9.1151, lr:0.0001
2019-07-19 02:44:12 INFO train.py: [0/600], [450/2174], step: 450, 4.050 samples/sec, batch_loss: 1.0000, batch_loss_c: 1.0000, batch_loss_s: 1.0000, time:9.8777, lr:0.0001

loss值一直没有变化,是什么原因呢

关于随机种子的设置

现在的情况是这样的:
image
我不知道为什么第一个epoch测试1000张图片需要1h,后边的epoch只需要6min就可以跑完?
在对其他数据集做训练的过程中随机种子还有必要存在吗?
大神,劳烦你了~

文本块问题

如何识别一句话,或者一行文本,而不是单词单词的进行识别

程序吐核

老哥,不管是用gpu还是cpu,运行predict.py每次都是吐核,很无语,你遇到过吗?

再训练

是不是只可以再resnet上进行训练,不能在自己已经训练好的模型上,再进行训练

代码中的一些问题及解决

作者的代码很棒,但是这几天我在实际的实验中遇到了一些问题并进行了其他几处改进,在这里分享一下。

  1. eval失败。解决:script.py文件中16,17行改为
    'GT_SAMPLE_NAME_2_ID': 'gt_img_([0-9]+).txt',
    'DET_SAMPLE_NAME_2_ID': 'res_img_([0-9]+).txt'

  2. 其他python版本编译pse.so出错。我修改makefile文件编译成功了。详情见:https://blog.csdn.net/ab0902cd/article/details/88352417

  3. 训练过程中writer保存了很多图片,但是我感觉用不到,而且保存图片后log文件会很大,可以添加一个if条件。例如添加:
    if config.display_input_images:

  4. scale设置2或4时报错,尺寸不匹配。原因是模型得到的图是160x160,但是label图是640x640的。 解决:看了一下原作者的代码,train时不设置scale,test时设置scale。

        if self.train:
            x = F.interpolate(x, size=(H, W), mode='bilinear', align_corners=True)
        else:
            x = F.interpolate(x, size=(H // self.scale, W // self.scale), mode='bilinear', align_corners=True)
  1. 加载模型出错。解决:train.py文件,main的 start_epoch = load_checkpoint(config.checkpoint, model, logger, device) ,load_checkpoint的参数optimizer是None时,不加载文件中记录的optimizer,不是None时,加载文件中记录的optimizer,但是文件中保存的不知道是sgd还是adam,在前面设置optimizer时如果不匹配会报错。这里我感觉最好是参数None,就不会报错。
    然后后面的MultiStepLR(optimizer, config.lr_decay_step, gamma=config.lr_gamma,last_epoch=-1),最后的参数设置-1,这个是我在其他issue里看到的。

6.保存太多模型文件。main这里我稍微改了一下,改成如果出现test结果更高的,就把以前存的所有文件删除。

               if f1 > best_model['f1']:
                    best_path = glob.glob(config.output_dir + '/Best_*.pth')
                    for b_path in best_path:
                        if os.path.exists(b_path):
                            os.remove(b_path)

                    best_model['recall'] = recall
                    best_model['precision'] = precision
                    best_model['f1'] = f1
                    best_model['models'] = net_save_path

                    best_save_path = '{}/Best_{}_r{:.6f}_p{:.6f}_f1{:.6f}.pth'.format(config.output_dir, epoch,
                                                                                              recall,
                                                                                              precision,
                                                                                              f1)
                    if os.path.exists(net_save_path):
                        shutil.copyfile(net_save_path, best_save_path)
                    else:
                        save_checkpoint(best_save_path, model, optimizer, epoch, logger)

                    pse_path = glob.glob(config.output_dir + '/PSENet_*.pth')
                    for p_path in pse_path:
                        if os.path.exists(p_path):
                            os.remove(p_path)

                writer.add_scalar(tag='Test/recall', scalar_value=recall, global_step=epoch)
                writer.add_scalar(tag='Test/precision', scalar_value=precision, global_step=epoch)
                writer.add_scalar(tag='Test/f1', scalar_value=f1, global_step=epoch)
        writer.close()
    except KeyboardInterrupt:
        save_checkpoint('{}/final.pth'.format(config.output_dir), model, optimizer, epoch, logger)
    finally:
        if best_model['models']:
            # shutil.copy(best_model['models'],
            #             '{}/best_r{:.6f}_p{:.6f}_f1{:.6f}.pth'.format(config.output_dir, best_model['recall'],
            #                                                           best_model['precision'], best_model['f1']))
            logger.info(best_model)

能否交流一下 loss 曲线的截图?

hi,我自己也实现了一遍 pse net 的 loss 部分,输入相同的 tensor 和你的 loss 输出是一样的,但是我训起来曲线很怪(如图),方便贴下你的 loss 图吗?谢谢
image

为什么不能从现有的模型文件继续训练呢?是我的设置方式不对吗?

config.py:
trainroot = './train'
testroot = './val'
output_dir = './results/v0_resnet50'
data_shape = 640

train config

gpu_id = '0'
workers = 2
start_epoch = 0
epochs = 100

train_batch_size = 8

lr = 1e-4
end_lr = 1e-7
lr_gamma = 0.1
lr_decay_step = [200,400]
weight_decay = 5e-4
warm_up_epoch = 6
warm_up_lr = lr * lr_gamma

display_interval = 10
show_images_interval = 50
pretrained = True
restart_training = False
checkpoint = './PSENet_23_loss0.138575_r0.518665_p0.792499_f10.626987.pth'

net config

backbone = 'resnet50'
Lambda = 0.7
n = 6
m = 0.5
OHEM_ratio = 3
scale = 1

random seed

seed = 2

但是一直会提示错误:
Traceback (most recent call last):
File "train.py", line 252, in
main()
File "train.py", line 199, in main
start_epoch = load_checkpoint(config.checkpoint, model, logger, device)
File "/data3/resys/zoutong/ocr/PSENet.pytorch/utils/utils.py", line 74, in load_checkpoint
model.load_state_dict(state['state_dict'])
File "/data/resys/anaconda2/envs/ocr_pytorch/lib/python3.6/site-packages/torch/nn/modules/module.py", line 777, in load_state_dict
self.class.name, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for PSENet:
Missing key(s) in state_dict: "backbone.conv1.weight", "backbone.bn1.weight", "backbone.bn1.bias", "backbone.bn1.running_mean", "backbone.bn1.running_var", "backbone.layer1.0.conv1.weight", "backbone.l.........

模型文件没有导对吗,不科学啊

训练的问题

当用eval函数校验模型时,会报ZIP entry not valid 的问题(Ubuntu18 cuda10 pytorch1.1.0)麻烦帮助解决一下。Thanks♪(・ω・)ノ
image

合并文本框

如何合并pse检测出的文本框?
15
应该如何合并这些相邻的文本框。
请给我一些建议,🙏。

大神,感觉效果没有提升呀,求指点一二

现在训练了50轮了,貌似在验证集上的分数只有0.64左右,感觉最后最多到0.65就算到头了/(ㄒoㄒ)/~~
我是在mtwi数据集上跑的,直接restart_training的,是不是应该在你的resnet-50上边接着训练会好一点,或者把ICDAR和MLT的数据集也加入进去一起训练,求前辈指点迷津~

Segmentation fault (core dumped)

亲爱的老哥,又要麻烦你了,我实在不知道为什么会跑出个这个错误。
是不是我编译pse出问题了,因为之前在训练过程的验证阶段,报错:找不到pse.cpp,所以我就删除了pse文件夹重新编译,当然在编译过程中,还是有错误,比如g++: error: unrecognized command line option ‘-fno-plt’,那么我把-fno-plt直接删去,又报:pse.cpp:1:0: error: bad value (haswell) for -mtune= switch,好吧,我又把-mtune=haswell删去,貌似编译通了,然后再次训练,在验证阶段,就凉了~~~~~
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.