Closed iamthebot closed 5 years ago
Crossposting apache/incubator-mxnet#15833
Loading VGG16 is now currently broken with MxNet 1.5.0 and Keras-MxNet 2.2.4.1
from keras.applications.vgg16 import VGG16 m = VGG16(weights=None, classes=365)
Produces
ValueError Traceback (most recent call last) <ipython-input-2-bb997f6d4e3d> in <module> ----> 1 m = VGG16(weights=None, classes=365) ~/.conda/envs/user/lib/python3.6/site-packages/keras/applications/__init__.py in wrapper(*args, **kwargs) 26 kwargs['models'] = models 27 kwargs['utils'] = utils ---> 28 return base_fun(*args, **kwargs) 29 30 return wrapper ~/.conda/envs/user/lib/python3.6/site-packages/keras/applications/vgg16.py in VGG16(*args, **kwargs) 9 @keras_modules_injection 10 def VGG16(*args, **kwargs): ---> 11 return vgg16.VGG16(*args, **kwargs) 12 13 ~/.conda/envs/user/lib/python3.6/site-packages/keras_applications/vgg16.py in VGG16(include_top, weights, input_tensor, input_shape, pooling, classes, **kwargs) 178 x = layers.Dense(4096, activation='relu', name='fc1')(x) 179 x = layers.Dense(4096, activation='relu', name='fc2')(x) --> 180 x = layers.Dense(classes, activation='softmax', name='predictions')(x) 181 else: 182 if pooling == 'avg': ~/.conda/envs/user/lib/python3.6/site-packages/keras/engine/base_layer.py in __call__(self, inputs, **kwargs) 468 # Actually call the layer, 469 # collecting output(s), mask(s), and shape(s). --> 470 output = self.call(inputs, **kwargs) 471 output_mask = self.compute_mask(inputs, previous_mask) 472 ~/.conda/envs/user/lib/python3.6/site-packages/keras/layers/core.py in call(self, inputs) 893 output = K.bias_add(output, self.bias, data_format='channels_last') 894 if self.activation is not None: --> 895 output = self.activation(output) 896 return output 897 ~/.conda/envs/user/lib/python3.6/site-packages/keras/activations.py in softmax(x, axis) 34 else: 35 raise ValueError('Cannot apply softmax to a tensor that is 1D. ' ---> 36 'Received input: %s' % x) 37 38 ValueError: Cannot apply softmax to a tensor that is 1D. Received input: Symbol: broadcast_add30
@iamthebot 2.2.4.2 is available now, https://github.com/awslabs/keras-apache-mxnet/releases/tag/2.2.4.2 this should be fixed. please reopen if this issue persists.
Crossposting apache/incubator-mxnet#15833
Loading VGG16 is now currently broken with MxNet 1.5.0 and Keras-MxNet 2.2.4.1
Produces