open-mmlab / mmocr

OpenMMLab Text Detection, Recognition and Understanding Toolbox
https://mmocr.readthedocs.io/en/dev-1.x/
Apache License 2.0
4.32k stars 747 forks source link

Correct way to put it in production #1289

Closed JRBusiness closed 2 years ago

JRBusiness commented 2 years ago

Hello @gaotongxiao,

Base on you reply here #1063, I still don't get the step to put it in production. I trained the KIE model with a custom dataset, and it yeild a good results when I tried it with kie_test.py, then I convert the checkpoint to .mar model, and serve it with Torchserver, however it give me this error.

     94 
     95         assert is_type_list(annotations, dict)
---> 96         assert len(annotations) > 0, 'Please remove data with empty annotation'
     97         assert 'box' in annotations[0]
     98         assert 'text' in annotations[0]

AssertionError: Please remove data with empty annotation

Any help is appreciated.

gaotongxiao commented 2 years ago

As prompted, the input was empty. Please carefully check your input flow again.

JRBusiness commented 2 years ago

Hi @gaotongxiao , thank you for the reply.

I went ahead and regenerate the custom dataset and retrain the model. Now when I serve the model, I did not receive error, but it keep on outputing this.

2022-08-20T07:46:08,017 [INFO ] pool-3-thread-2 TS_METRICS - CPUUtilization.Percent:0.0|#Level:Host|#hostname:3012d4bdaa5e,timestamp:1660981568
2022-08-20T07:46:08,017 [INFO ] pool-3-thread-2 TS_METRICS - DiskAvailable.Gigabytes:116.89881134033203|#Level:Host|#hostname:3012d4bdaa5e,timestamp:1660981568
2022-08-20T07:46:08,018 [INFO ] pool-3-thread-2 TS_METRICS - DiskUsage.Gigabytes:49.91762161254883|#Level:Host|#hostname:3012d4bdaa5e,timestamp:1660981568
2022-08-20T07:46:08,018 [INFO ] pool-3-thread-2 TS_METRICS - DiskUtilization.Percent:29.9|#Level:Host|#hostname:3012d4bdaa5e,timestamp:1660981568
2022-08-20T07:46:08,018 [INFO ] pool-3-thread-2 TS_METRICS - GPUMemoryUtilization.Percent:0.0|#Level:Host,device_id:0|#hostname:3012d4bdaa5e,timestamp:1660981568
2022-08-20T07:46:08,018 [INFO ] pool-3-thread-2 TS_METRICS - GPUMemoryUsed.Megabytes:0|#Level:Host,device_id:0|#hostname:3012d4bdaa5e,timestamp:1660981568
2022-08-20T07:46:08,019 [INFO ] pool-3-thread-2 TS_METRICS - GPUUtilization.Percent:0|#Level:Host,device_id:0|#hostname:3012d4bdaa5e,timestamp:1660981568
2022-08-20T07:46:08,019 [INFO ] pool-3-thread-2 TS_METRICS - MemoryAvailable.Megabytes:50677.296875|#Level:Host|#hostname:3012d4bdaa5e,timestamp:1660981568
2022-08-20T07:46:08,019 [INFO ] pool-3-thread-2 TS_METRICS - MemoryUsed.Megabytes:1075.27734375|#Level:Host|#hostname:3012d4bdaa5e,timestamp:1660981568
2022-08-20T07:46:08,019 [INFO ] pool-3-thread-2 TS_METRICS - MemoryUtilization.Percent:3.0|#Level:Host|#hostname:3012d4bdaa5e,timestamp:1660981568

Did I do anything wrong? and how do I resolve this?

Thank you

JRBusiness commented 2 years ago

Correct the dataset as the required format solved this issue. I am closing this. Thank you @gaotongxiao