auto compile post_process of pse

pull/3376/head
WenmuZhou 2021-07-30 09:57:23 +08:00
parent 026f96b657
commit d173bba374
3 changed files with 5 additions and 13 deletions

View File

@ -81,13 +81,6 @@ python3 -m paddle.distributed.launch --gpus '0,1,2,3' tools/train.py -c configs/
python3 tools/train.py -c configs/det/det_mv3_db.yml -o Optimizer.base_lr=0.0001
```
若训练PSE算法需先编译后处理
```bash
cd ppocr/postprocess/pse_postprocess/pse
python3 setup.py build_ext --inplace
```
#### 断点训练
如果训练程序中断如果希望加载训练中断的模型从而恢复训练可以通过指定Global.checkpoints指定要加载的模型路径

View File

@ -69,12 +69,6 @@ python3 tools/train.py -c configs/det/det_mv3_db.yml -o Optimizer.base_lr=0.0001
python3 -m paddle.distributed.launch --gpus '0,1,2,3' tools/train.py -c configs/det/det_mv3_db.yml -o Optimizer.base_lr=0.0001
```
If you train the PSE algorithm, you need to compile the post-processing first.
```bash
cd ppocr/postprocess/pse_postprocess/pse
python3 setup.py build_ext --inplace
```
#### load trained model and continue training
If you expect to load trained model and continue the training again, you can specify the parameter `Global.checkpoints` as the model path to be loaded.

View File

@ -11,5 +11,10 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import subprocess
if subprocess.call('cd ppocr/postprocess/pse_postprocess/pse;python3 setup.py build_ext --inplace;cd -', shell=True) != 0:
raise RuntimeError('Cannot compile pse: {}'.format(os.path.dirname(os.path.realpath(__file__))))
from .pse import pse