Permalink
Browse files

upgrade to keras 1.0

  • Loading branch information...
1 parent 68c7595 commit 72a442ea74eccb8dd7e5d4f6c9e22d5a4f14d786 @awentzonline committed Dec 4, 2016
Showing with 16 additions and 20 deletions.
  1. +11 −11 image_analogy/argparser.py
  2. +1 −1 image_analogy/models/base.py
  3. +1 −1 requirements.txt
  4. +3 −7 setup.py
@@ -95,17 +95,17 @@ def parse_args():
# hack for CPU users :(
assert args.a_scale_mode in ('ratio', 'none', 'match'), 'a-scale-mode must be set to one of "ratio", "none", or "match"'
- if K._BACKEND == 'theano':
- from keras.backend import theano_backend
- if args.a_scale_mode != 'match':
- if not theano_backend._on_gpu():
- print('Theano CPU mode detected. Forcing a-scale-mode to "match"')
- args.a_scale_mode = 'match' # prevent conv2d errors when using CPU
- args.a_scale = 1.0
- elif theano_backend.dnn and not theano_backend.dnn.dnn_available():
- print('Theano CUDA without cuDNN detected. Forcing a-scale-mode to "match"')
- args.a_scale_mode = 'match' # prevent conv2d errors when using CUDA without cuDNN
- args.a_scale = 1.0
+ # if K.backend() == 'theano':
+ # from keras.backend import theano_backend
+ # if args.a_scale_mode != 'match':
+ # if not theano_backend._on_gpu():
+ # print('Theano CPU mode detected. Forcing a-scale-mode to "match"')
+ # args.a_scale_mode = 'match' # prevent conv2d errors when using CPU
+ # args.a_scale = 1.0
+ # elif theano_backend.dnn and not theano_backend.dnn.dnn_available():
+ # print('Theano CUDA without cuDNN detected. Forcing a-scale-mode to "match"')
+ # args.a_scale_mode = 'match' # prevent conv2d errors when using CUDA without cuDNN
+ # args.a_scale = 1.0
# make sure weights are in place
if not os.path.exists(args.vgg_weights):
@@ -69,7 +69,7 @@ def get_f_layer(self, layer_name):
def get_layer_output(self, name):
if not name in self._f_layer_outputs:
layer = self.layer_map[name]
- self._f_layer_outputs[name] = layer.get_output()
+ self._f_layer_outputs[name] = layer.output
return self._f_layer_outputs[name]
def get_layer_output_shape(self, name):
View
@@ -1,6 +1,6 @@
Cython==0.23.4
h5py==2.5.0
-Keras==0.3.2
+Keras==1.1.1
numpy==1.10.4
Pillow==3.1.1
PyYAML==3.11
View
@@ -4,7 +4,7 @@
setup(
name='neural-image-analogies',
- version='0.0.11',
+ version='0.1.0',
description='Generate image analogies with a deep neural network.',
author='Adam Wentz',
author_email='adam@adamwentz.com',
@@ -14,18 +14,14 @@
'scripts/make_image_analogy.py'
],
install_requires=[
- 'Cython>=0.23.4',
'h5py>=2.5.0',
- 'Keras>=0.3.2',
+ 'Keras>=1.0.0',
'numpy>=1.10.4',
'Pillow>=3.1.1',
'PyYAML>=3.11',
'scipy>=0.17.0',
'scikit-learn>=0.17.0',
'six>=1.10.0',
- 'Theano>=0.8.0rc1',
- ],
- dependency_links=[
- 'https://github.com/Theano/Theano.git@954c3816a40de172c28124017a25387f3bf551b2#egg=Theano'
+ 'Theano>=0.8.2',
]
)

0 comments on commit 72a442e

Please sign in to comment.