You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I am trying to run the MNIST Example of keras pruning Link, I get the following Traceback.
Tensorflow Version: Name: tensorflow Version: 2.0.0a0
Traceback
--> 156 layerwise_model = build_layerwise_model(input_shape, **pruning_params)
157 sequential_model = build_sequential_model(input_shape)
158 sequential_model = prune.prune_low_magnitude(
<ipython-input-9-8bf64bf9319d> in build_layerwise_model(input_shape, **pruning_params)
73 l.Dropout(0.4),
74 prune.prune_low_magnitude(
---> 75 l.Dense(num_classes, activation='softmax'), **pruning_params)
76 ])
77
/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/tracking/base.py in _method_wrapper(self, *args, **kwargs)
454 self._setattr_tracking = False # pylint: disable=protected-access
455 try:
--> 456 result = method(self, *args, **kwargs)
457 finally:
458 self._setattr_tracking = previous_value # pylint: disable=protected-access
/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/sequential.py in __init__(self, layers, name)
106 if layers:
107 for layer in layers:
--> 108 self.add(layer)
109
110 @property
/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/tracking/base.py in _method_wrapper(self, *args, **kwargs)
454 self._setattr_tracking = False # pylint: disable=protected-access
455 try:
--> 456 result = method(self, *args, **kwargs)
457 finally:
458 self._setattr_tracking = previous_value # pylint: disable=protected-access
/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/sequential.py in add(self, layer)
167 # and create the node connecting the current layer
168 # to the input layer we just created.
--> 169 layer(x)
170 set_inputs = True
171
/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/base_layer.py in __call__(self, inputs, *args, **kwargs)
592 # Build layer if applicable (if the `build` method has been
593 # overridden).
--> 594 self._maybe_build(inputs)
595 # Explicitly pass the learning phase placeholder to `call` if
596 # the `training` argument was left unspecified by the user.
/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/base_layer.py in _maybe_build(self, inputs)
1711 # Only call `build` if the user has manually overridden the build method.
1712 if not hasattr(self.build, '_is_default'):
-> 1713 self.build(input_shapes)
1714 # We must set self.built since user defined build functions are not
1715 # constrained to set self.built.
/usr/local/lib/python3.6/dist-packages/tensorflow_model_optimization/python/core/sparsity/keras/pruning_wrapper.py in build(self, input_shape)
173 weight_vars, mask_vars, threshold_vars = [], [], []
174
--> 175 self.prunable_weights = self.layer.get_prunable_weights()
176
177 # For each of the prunable weights, add mask and threshold variables
/usr/local/lib/python3.6/dist-packages/tensorflow_model_optimization/python/core/sparsity/keras/prune_registry.py in get_prunable_weights()
167
168 def get_prunable_weights():
--> 169 return [getattr(layer, weight) for weight in cls._weight_names(layer)]
170
171 def get_prunable_weights_rnn(): # pylint: disable=missing-docstring
/usr/local/lib/python3.6/dist-packages/tensorflow_model_optimization/python/core/sparsity/keras/prune_registry.py in <listcomp>(.0)
167
168 def get_prunable_weights():
--> 169 return [getattr(layer, weight) for weight in cls._weight_names(layer)]
170
171 def get_prunable_weights_rnn(): # pylint: disable=missing-docstring
AttributeError: 'Conv2D' object has no attribute 'kernel'
I am not using absl-py to run the main(), because I am using colab, therefore, I have also commented out the eager execution line.
Can anyone please help me this, where I am going wrong, or is this a bug?
The text was updated successfully, but these errors were encountered:
When I am trying to run the MNIST Example of keras pruning Link, I get the following Traceback.
Tensorflow Version:
Name: tensorflow Version: 2.0.0a0
Traceback
I am not using absl-py to run the main(), because I am using colab, therefore, I have also commented out the eager execution line.
Can anyone please help me this, where I am going wrong, or is this a bug?
The text was updated successfully, but these errors were encountered: