未验证 提交 fce342dc 编写于 作者: K Kaipeng Deng 提交者: GitHub

fix mixup error when dataset has only 1 sample (#101)

* fix mixup error when dataset has only 1 sample

* refine log
上级 497e0e27
...@@ -28,6 +28,9 @@ import copy ...@@ -28,6 +28,9 @@ import copy
import pickle as pkl import pickle as pkl
from ..dataset import Dataset from ..dataset import Dataset
import logging
logger = logging.getLogger(__name__)
class RoiDbSource(Dataset): class RoiDbSource(Dataset):
""" interface to load roidb data from files """ interface to load roidb data from files
...@@ -134,6 +137,11 @@ class RoiDbSource(Dataset): ...@@ -134,6 +137,11 @@ class RoiDbSource(Dataset):
if self._is_shuffle: if self._is_shuffle:
random.shuffle(self._roidb) random.shuffle(self._roidb)
if self._mixup_epoch > 0 and self._samples < 2:
logger.info("Disable mixup for dataset samples "
"less than 2 samples")
self._mixup_epoch = -1
if self._epoch < 0: if self._epoch < 0:
self._epoch = 0 self._epoch = 0
else: else:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册