提交 d173bba3 编写于 作者: W WenmuZhou

auto compile post_process of pse

上级 026f96b6
......@@ -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指定要加载的模型路径:
......
......@@ -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.
......
......@@ -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
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册