提交 638f95ad 编写于 作者: W walloollaw 提交者: qingqing01

fix bug about data_feed.py (#2989)

上级 d7260cf9
......@@ -59,7 +59,8 @@ def load_config(file_path):
"""
_, ext = os.path.splitext(file_path)
assert ext in ['.yml', '.yaml'], "only support yaml files for now"
merge_config(yaml.load(open(file_path), Loader=yaml.Loader))
with open(file_path) as f:
merge_config(yaml.load(f, Loader=yaml.Loader))
return global_config
......
......@@ -58,12 +58,6 @@ def _prepare_data_config(feed, args_path):
mixup_epoch = -1
if getattr(feed, 'mixup_epoch', None) is not None:
mixup_epoch = feed.mixup_epoch
bufsize = 10
use_process = False
if getattr(feed, 'bufsize', None) is not None:
bufsize = feed.bufsize
if getattr(feed, 'use_process', None) is not None:
use_process = feed.use_process
data_config = {
'ANNO_FILE': feed.dataset.annotation,
......@@ -96,6 +90,13 @@ def create_reader(feed, max_iter=0, args_path=None, my_source=None):
# named `DATASET_DIR` (e.g., coco, pascal), if not present either, download
data_config = _prepare_data_config(feed, args_path)
bufsize = 10
use_process = False
if getattr(feed, 'bufsize', None) is not None:
bufsize = feed.bufsize
if getattr(feed, 'use_process', None) is not None:
use_process = feed.use_process
transform_config = {
'WORKER_CONF': {
'bufsize': bufsize,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册