提交 c0268db6 编写于 作者: W WuHaobo

Merge branch 'master' of https://github.com/WuHaobo/PaddleClas

...@@ -13,16 +13,15 @@ ...@@ -13,16 +13,15 @@
#limitations under the License. #limitations under the License.
import cv2 import cv2
import numpy as np import numpy as np
import os import os
import signal import signal
import paddle import paddle
import imaug from . import imaug
from imaug import transform from .imaug import transform
from imaug import MixupOperator from .imaug import MixupOperator
from ppcls.utils import logger from ppcls.utils import logger
trainers_num = int(os.environ.get('PADDLE_TRAINERS_NUM', 1)) trainers_num = int(os.environ.get('PADDLE_TRAINERS_NUM', 1))
...@@ -190,9 +189,9 @@ def partial_reader(params, full_lines, part_id=0, part_num=1): ...@@ -190,9 +189,9 @@ def partial_reader(params, full_lines, part_id=0, part_num=1):
for line in full_lines: for line in full_lines:
img_path, label = line.split() img_path, label = line.split()
img_path = os.path.join(params['data_dir'], img_path) img_path = os.path.join(params['data_dir'], img_path)
img = open(img_path).read() with open(img_path, 'rb') as f:
img = transform(img, ops) img = f.read()
yield (img, int(label)) yield (transform(img, ops), int(label))
return reader return reader
......
...@@ -12,10 +12,11 @@ ...@@ -12,10 +12,11 @@
#See the License for the specific language governing permissions and #See the License for the specific language governing permissions and
#limitations under the License. #limitations under the License.
import architectures
import types import types
from difflib import SequenceMatcher from difflib import SequenceMatcher
from . import architectures
def get_architectures(): def get_architectures():
""" """
......
...@@ -15,5 +15,5 @@ ...@@ -15,5 +15,5 @@
from . import optimizer from . import optimizer
from . import learning_rate from . import learning_rate
from optimizer import OptimizerBuilder from .optimizer import OptimizerBuilder
from learning_rate import LearningRateBuilder from .learning_rate import LearningRateBuilder
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册