提交 16bebc43 编写于 作者: L Luo Tao

some tiny fix

上级 737f2bf3
......@@ -24,21 +24,20 @@ def hook(settings, src_dict_path, trg_dict_path, is_generating, file_list,
# job_mode = 1: training mode
# job_mode = 0: generating mode
settings.job_mode = not is_generating
settings.src_dict = dict()
with open(src_dict_path, "r") as fin:
settings.src_dict = {
line.strip(): line_count
for line_count, line in enumerate(fin)
}
settings.trg_dict = dict()
with open(trg_dict_path, "r") as fin:
settings.trg_dict = {
def fun(dict_path):
out_dict = dict()
with open(dict_path, "r") as fin:
out_dict = {
line.strip(): line_count
for line_count, line in enumerate(fin)
}
return out_dict
settings.src_dict = fun(src_dict_path)
settings.trg_dict = fun(trg_dict_path)
settings.logger.info("src dict len : %d" % (len(settings.src_dict)))
settings.sample_count = 0
if settings.job_mode:
settings.slots = {
......
body {
padding-top: 80px;
background-image: none !important;
......
......@@ -1872,7 +1872,7 @@ class BatchNormLayer(LayerBase):
image_conf = self.config.inputs[0].image_conf
parse_image(self.inputs[0].image, input_layer.name, image_conf)
self.set_cnn_layer(name, image_conf.img_size_y, image_conf.img_size,
image_conf.channels)
image_conf.channels, False)
psize = self.calc_parameter_size(image_conf)
dims = [1, psize]
......@@ -3387,7 +3387,8 @@ def parse_config(config_file, config_arg_str):
# config = parse_config(configs, "is_predict=1")
# # then you get config proto object.
if hasattr(config_file, '__call__'):
config_file.func_globals.update(make_config_environment("", config_args))
config_file.func_globals.update(
make_config_environment("", config_args))
config_file()
else:
execfile(config_file, make_config_environment(config_file, config_args))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册