keplr-io / quiver

Interactive convnet features visualization for Keras
https://keplr-io.github.io/quiver/
MIT License
1.77k stars 223 forks source link

InceptionResNetV2 and InceptionV3 get error But VGG16 is good #60

Open MacwinWin opened 6 years ago

MacwinWin commented 6 years ago

It seems that can not reshape the custom image. But in VGG16 has not error. [2017-11-30 18:08:12,769] ERROR in app: Exception on /layer/batch_normalization_90/individualImage (2).png [GET] Traceback (most recent call last): File "/home/microfat/.local/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app response = self.full_dispatch_request() File "/home/microfat/.local/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request rv = self.handle_user_exception(e) File "/home/microfat/.local/lib/python3.6/site-packages/flask_cors/extension.py", line 161, in wrapped_function return cors_after_request(app.make_response(f(*args, **kwargs))) File "/home/microfat/.local/lib/python3.6/site-packages/flask/app.py", line 1517, in handle_user_exception reraise(exc_type, exc_value, tb) File "/home/microfat/.local/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise raise value File "/home/microfat/.local/lib/python3.6/site-packages/flask/app.py", line 1612, in full_dispatch_request rv = self.dispatch_request() File "/home/microfat/.local/lib/python3.6/site-packages/flask/app.py", line 1598, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File "/home/microfat/.local/lib/python3.6/site-packages/quiver_engine/server.py", line 98, in get_layer_outputs mean=mean, std=std File "/home/microfat/.local/lib/python3.6/site-packages/quiver_engine/util.py", line 83, in load_img grayscale=grayscale) File "/home/microfat/.local/lib/python3.6/site-packages/keras/preprocessing/image.py", line 364, in load_img img = img.resize(width_height_tuple, resample) File "/home/microfat/.local/lib/python3.6/site-packages/PIL/Image.py", line 1745, in resize return self._new(self.im.resize(size, resample, box)) TypeError: an integer is required (got type NoneType)

taichu012 commented 6 years ago

I append a link (http://blog.csdn.net/macwinwin/article/details/78680287), which maybe talk about the same thing and same issues. author of link suggest to adapt LOACL keras codes of applications.py and please see detail in links (ignore chinese descriptions, just look codes below). This is all not tested by me, just give a suggestion and hopes it will work.

ghost commented 5 years ago

I have this too.

[2019-03-14 22:28:29,143] ERROR in app: Exception on /layer/multiply_5/1.png [GET]
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/flask/app.py", line 2292, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/lib/python3.7/site-packages/flask/app.py", line 1815, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/lib/python3.7/site-packages/flask_cors/extension.py", line 161, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/usr/lib/python3.7/site-packages/flask/app.py", line 1718, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/lib/python3.7/site-packages/flask/_compat.py", line 35, in reraise
    raise value
  File "/usr/lib/python3.7/site-packages/flask/app.py", line 1813, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/lib/python3.7/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/lib/python3.7/site-packages/quiver_engine/server.py", line 97, in get_layer_outputs
    input_img = load_img(join(abspath(input_folder), input_path), single_input_shape, grayscale=is_grayscale)
  File "/usr/lib/python3.7/site-packages/quiver_engine/util.py", line 27, in load_img
    img = image.load_img(input_path, target_size=target_shape, grayscale=grayscale)
  File "/usr/lib/python3.7/site-packages/keras_preprocessing/image/utils.py", line 126, in load_img
    img = img.resize(width_height_tuple, resample)
  File "/usr/lib/python3.7/site-packages/PIL/Image.py", line 1806, in resize
    return self._new(self.im.resize(size, resample, box))
TypeError: an integer is required (got type NoneType)
::1 - - [2019-03-14 22:28:29] "GET /layer/multiply_5/1.png HTTP/1.1" 500 444 0.003197
[2019-03-14 22:28:32,998] ERROR in app: Exception on /layer/conv2d_20/1.png [GET]
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/flask/app.py", line 2292, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/lib/python3.7/site-packages/flask/app.py", line 1815, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/lib/python3.7/site-packages/flask_cors/extension.py", line 161, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/usr/lib/python3.7/site-packages/flask/app.py", line 1718, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/lib/python3.7/site-packages/flask/_compat.py", line 35, in reraise
    raise value
  File "/usr/lib/python3.7/site-packages/flask/app.py", line 1813, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/lib/python3.7/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/lib/python3.7/site-packages/quiver_engine/server.py", line 97, in get_layer_outputs
    input_img = load_img(join(abspath(input_folder), input_path), single_input_shape, grayscale=is_grayscale)
  File "/usr/lib/python3.7/site-packages/quiver_engine/util.py", line 27, in load_img
    img = image.load_img(input_path, target_size=target_shape, grayscale=grayscale)
  File "/usr/lib/python3.7/site-packages/keras_preprocessing/image/utils.py", line 126, in load_img
    img = img.resize(width_height_tuple, resample)
  File "/usr/lib/python3.7/site-packages/PIL/Image.py", line 1806, in resize
    return self._new(self.im.resize(size, resample, box))
TypeError: an integer is required (got type NoneType)
::1 - - [2019-03-14 22:28:33] "GET /layer/conv2d_20/1.png HTTP/1.1" 500 444 0.002933
[2019-03-14 22:28:35,131] ERROR in app: Exception on /layer/multiply_4/1.png [GET]
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/flask/app.py", line 2292, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/lib/python3.7/site-packages/flask/app.py", line 1815, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/lib/python3.7/site-packages/flask_cors/extension.py", line 161, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/usr/lib/python3.7/site-packages/flask/app.py", line 1718, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/lib/python3.7/site-packages/flask/_compat.py", line 35, in reraise
    raise value
  File "/usr/lib/python3.7/site-packages/flask/app.py", line 1813, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/lib/python3.7/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/lib/python3.7/site-packages/quiver_engine/server.py", line 97, in get_layer_outputs
    input_img = load_img(join(abspath(input_folder), input_path), single_input_shape, grayscale=is_grayscale)
  File "/usr/lib/python3.7/site-packages/quiver_engine/util.py", line 27, in load_img
    img = image.load_img(input_path, target_size=target_shape, grayscale=grayscale)
  File "/usr/lib/python3.7/site-packages/keras_preprocessing/image/utils.py", line 126, in load_img
    img = img.resize(width_height_tuple, resample)
  File "/usr/lib/python3.7/site-packages/PIL/Image.py", line 1806, in resize
    return self._new(self.im.resize(size, resample, box))
TypeError: an integer is required (got type NoneType)
::1 - - [2019-03-14 22:28:35] "GET /layer/multiply_4/1.png HTTP/1.1" 500 444 0.002803
[bckpkol@manjaro-core2-bck Superres]$ uname -a
Linux manjaro-core2-bck 4.20.13.a-1-hardened #1 SMP PREEMPT Fri Mar 1 00:11:50 CET 2019 x86_64 GNU/Linux
Name: Keras
Version: 2.2.4
Summary: Deep Learning for humans
Home-page: https://github.com/keras-team/keras
Author: Francois Chollet
Author-email: francois.chollet@gmail.com
License: MIT
Location: /usr/lib/python3.7/site-packages
Requires: h5py, pyyaml, scipy, keras-applications, keras-preprocessing, numpy, six
Required-by:
Name: tensorflow
Version: 1.13.1
Summary: TensorFlow is an open source machine learning framework for everyone.
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: opensource@google.com
License: Apache 2.0
Location: /usr/lib/python3.7/site-packages
Requires: keras-applications, keras-preprocessing, termcolor, protobuf, numpy, tensorboard, grpcio, wheel, tensorflow-estimator, astor, six, gast, absl-py
Required-by: quiver-engine
Name: quiver-engine
Version: 0.1.4.1.4
Summary: Interactive per-layer visualization for convents in keras
Home-page: UNKNOWN
Author: Jake Bian
Author-email: jake@keplr.io
License: mit
Location: /usr/lib/python3.7/site-packages
Requires: flask, keras, pillow, numpy, tensorflow, flask-cors, gevent
Required-by: