Skip to content

Commit

Permalink
Merge pull request #10 from Infinoid/master
Browse files Browse the repository at this point in the history
Fixes for newer versions of numpy and scipy
  • Loading branch information
conan7882 authored Mar 11, 2020
2 parents 6cbedce + 9d8d0ad commit 2a015d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/nets/googlenet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}

Expand Down
6 changes: 3 additions & 3 deletions src/utils/dataflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Author: Qian Ge <[email protected]>

import os
import scipy.misc
import imageio
import numpy as np
from datetime import datetime

Expand All @@ -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)
Expand Down

0 comments on commit 2a015d1

Please sign in to comment.