forked from mindspore-Ecosystem/mindspore
!6242 fix codedex warning in warpctc
Merge pull request !6242 from gengdongjie/master
This commit is contained in:
commit
bd8cf0c14f
|
@ -326,6 +326,7 @@ sh run_distribute_train.sh [RANK_TABLE_FILE] [PRETRAINED_MODEL]
|
||||||
|
|
||||||
> hccl.json which is specified by RANK_TABLE_FILE is needed when you are running a distribute task. You can generate it by using the [hccl_tools](https://gitee.com/mindspore/mindspore/tree/master/model_zoo/utils/hccl_tools).
|
> hccl.json which is specified by RANK_TABLE_FILE is needed when you are running a distribute task. You can generate it by using the [hccl_tools](https://gitee.com/mindspore/mindspore/tree/master/model_zoo/utils/hccl_tools).
|
||||||
> As for PRETRAINED_MODEL, if not set, the model will be trained from the very beginning. Ready-made pretrained_models are not available now. Stay tuned.
|
> As for PRETRAINED_MODEL, if not set, the model will be trained from the very beginning. Ready-made pretrained_models are not available now. Stay tuned.
|
||||||
|
> This is processor cores binding operation regarding the `device_num` and total processor numbers. If you are not expect to do it, remove the operations `taskset` in `scripts/run_distribute_train.sh`
|
||||||
|
|
||||||
### [Training Result](#content)
|
### [Training Result](#content)
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
# ============================================================================
|
# ============================================================================
|
||||||
"""Generate train and test dataset"""
|
"""Generate train and test dataset"""
|
||||||
import os
|
import os
|
||||||
|
import shutil
|
||||||
import math as m
|
import math as m
|
||||||
import random
|
import random
|
||||||
from multiprocessing import Process
|
from multiprocessing import Process
|
||||||
|
@ -46,11 +47,14 @@ def generate_captcha(name, img_num, img_width, img_height, max_digits, process_n
|
||||||
process_num(int): number of process to generate captcha images, default is 16
|
process_num(int): number of process to generate captcha images, default is 16
|
||||||
"""
|
"""
|
||||||
cur_script_path = os.path.dirname(os.path.realpath(__file__))
|
cur_script_path = os.path.dirname(os.path.realpath(__file__))
|
||||||
path = os.path.join(cur_script_path, "data", name)
|
path_data = os.path.join(cur_script_path, "data")
|
||||||
|
if not os.path.exists(path_data):
|
||||||
|
os.mkdir(path_data)
|
||||||
|
path = os.path.join(path_data, name)
|
||||||
print("Generating dataset [{}] under {}...".format(name, path))
|
print("Generating dataset [{}] under {}...".format(name, path))
|
||||||
if os.path.exists(path):
|
if os.path.exists(path):
|
||||||
os.system("rm -rf {}".format(path))
|
shutil.rmtree(path)
|
||||||
os.system("mkdir -p {}".format(path))
|
os.mkdir(path)
|
||||||
img_num_per_thread = m.ceil(img_num / process_num)
|
img_num_per_thread = m.ceil(img_num / process_num)
|
||||||
|
|
||||||
processes = []
|
processes = []
|
||||||
|
|
Loading…
Reference in New Issue