model.layers[layer_idx].activation = activations.linear
model = utils.apply_modifications(model)
results in
File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/keras_vis-0.4.1-py3.6.egg/vis/utils/utils.py", line 113, in apply_modifications
return load_model(model_path)
File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/keras/models.py", line 246, in load_model
model = model_from_config(model_config, custom_objects=custom_objects)
File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/keras/models.py", line 314, in model_from_config
return layer_module.deserialize(config, custom_objects=custom_objects)
File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/keras/layers/init.py", line 54, in deserialize
printable_module_name='layer')
File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/keras/utils/generic_utils.py", line 140, in deserialize_keras_object
list(custom_objects.items())))
File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/keras/engine/topology.py", line 2450, in from_config
process_layer(layer_data)
File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/keras/engine/topology.py", line 2419, in process_layer
custom_objects=custom_objects)
File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/keras/layers/init.py", line 54, in deserialize
printable_module_name='layer')
File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/keras/utils/generic_utils.py", line 142, in deserialize_keras_object
return cls.from_config(config['config'])
File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/keras/engine/topology.py", line 1242, in from_config
return cls(**config)
File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/keras/layers/advanced_activations.py", line 38, in init
self.alpha = K.cast_to_floatx(alpha)
File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/keras/backend/common.py", line 108, in cast_to_floatx
return np.asarray(x, dtype=_FLOATX)
File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/numpy/core/numeric.py", line 531, in asarray
return array(a, dtype, copy=False, order=order)
TypeError: float() argument must be a string or a number, not 'dict'
model.layers[layer_idx].activation = activations.linear model = utils.apply_modifications(model)
results in
File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/keras_vis-0.4.1-py3.6.egg/vis/utils/utils.py", line 113, in apply_modifications return load_model(model_path) File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/keras/models.py", line 246, in load_model model = model_from_config(model_config, custom_objects=custom_objects) File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/keras/models.py", line 314, in model_from_config return layer_module.deserialize(config, custom_objects=custom_objects) File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/keras/layers/init.py", line 54, in deserialize printable_module_name='layer') File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/keras/utils/generic_utils.py", line 140, in deserialize_keras_object list(custom_objects.items()))) File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/keras/engine/topology.py", line 2450, in from_config process_layer(layer_data) File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/keras/engine/topology.py", line 2419, in process_layer custom_objects=custom_objects) File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/keras/layers/init.py", line 54, in deserialize printable_module_name='layer') File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/keras/utils/generic_utils.py", line 142, in deserialize_keras_object return cls.from_config(config['config']) File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/keras/engine/topology.py", line 1242, in from_config return cls(**config) File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/keras/layers/advanced_activations.py", line 38, in init self.alpha = K.cast_to_floatx(alpha) File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/keras/backend/common.py", line 108, in cast_to_floatx return np.asarray(x, dtype=_FLOATX) File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/numpy/core/numeric.py", line 531, in asarray return array(a, dtype, copy=False, order=order) TypeError: float() argument must be a string or a number, not 'dict'