Skip to content

Commit

Permalink
Ignore UserWarnings from chainer.CaffeFunction
Browse files Browse the repository at this point in the history
  • Loading branch information
rezoo committed Sep 24, 2015
1 parent c7840fb commit c1cea99
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion i2v/chainer_i2v.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from i2v.base import Illustration2VecBase
import json
import warnings
import numpy as np
from scipy.ndimage import zoom
from skimage.transform import resize
Expand Down Expand Up @@ -64,7 +65,10 @@ def _extract(self, inputs, layername):
return y.data

def make_i2v_with_chainer(param_path, tag_path=None):
net = CaffeFunction(param_path)
# ignore UserWarnings from chainer
with warnings.catch_warnings():
warnings.simplefilter('ignore')
net = CaffeFunction(param_path)
if tag_path is not None:
tags = json.loads(open(tag_path, 'r').read())
assert(len(tags) == 1539)
Expand Down

0 comments on commit c1cea99

Please sign in to comment.