diff --git a/src/nets/googlenet.py b/src/nets/googlenet.py index 9e620dc..d12c36f 100644 --- a/src/nets/googlenet.py +++ b/src/nets/googlenet.py @@ -30,7 +30,7 @@ def __init__(self, n_channel, n_class, pre_trained_path=None, self._pretrained_dict = None if pre_trained_path: self._pretrained_dict = np.load( - pre_trained_path, encoding='latin1').item() + pre_trained_path, encoding='latin1', allow_pickle=True).item() self.layers = {} diff --git a/src/utils/dataflow.py b/src/utils/dataflow.py index b145032..9e7c2d4 100644 --- a/src/utils/dataflow.py +++ b/src/utils/dataflow.py @@ -4,7 +4,7 @@ # Author: Qian Ge import os -import scipy.misc +import imageio import numpy as np from datetime import datetime @@ -18,9 +18,9 @@ def load_image(im_path, read_channel=None, pf=identity): if read_channel is None: im = scipy.misc.imread(im_path) elif read_channel == 3: - im = scipy.misc.imread(im_path, mode='RGB') + im = imageio.imread(im_path, pilmode='RGB') else: - im = scipy.misc.imread(im_path, flatten=True) + im = imageio.imread(im_path, flatten=True) if len(im.shape) < 3: im = pf(im)