0

I have a CNN model that I made using Keras using MXNet as the backend. I am able to create, train, and export a model without a hitch. However, when I attempted to load this model to the DeepLens, I get the following error:

ValueError: [91mYou created Module with Module(..., data_names=['data']) but input with name 'data' is not found in symbol.list_arguments(). Did you mean one of:
        /conv2d_1_input1
        conv2d_1/kernel1
        conv2d_1/bias1
        conv2d_2/kernel1
        conv2d_2/bias1
        conv2d_3/kernel1
        conv2d_3/bias1
        dense_1/kernel1
        dense_1/bias1
        dense_2/kernel1
        dense_2/bias1
        dense_3/kernel1
        dense_3/bias1[0m

I never made an argument for a symbol named data. All of the other symbols make sense because those were derived from my model. I have added all the code associated with Keras CNN creation below.

model = Sequential()
model.add(Conv2D(8, (1,1), input_shape=inputShape))
model.add(Dropout(0.5))
model.add(Activation('relu'))

model.add(Conv2D(16, (1,1), padding='same'))
model.add(Dropout(0.5))
model.add(Activation('relu'))

model.add(Conv2D(32, (1,1), padding='same'))
model.add(Dropout(0.5))
model.add(Activation('relu'))

model.add(Flatten())
model.add(Dense(240))

model.add(Activation('relu'))
model.add(Dense(120))

model.add(Dense(2))
model.add(Activation('sigmoid'))

Is there a way around this or a way to work with this using Keras with MXNet as the backend? Do I have to run a command on the Amazon Deeplens? Is there something I have to add into the model?

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470

1 Answers1

0

Effectively the problem is that the default name of the input symbol in MXNet is data. In Keras it seems that the default name used for the input symbol is /conv2d_1_input1. You can two things:

  • Rename the /conv2d_1_input1 symbol in your -symbol.json file to data.
  • I am not very familiar with how managed the deep lens is, but if you have access to the code that does: Module(..., data_names=['data']) replace it with Module(..., data_names=['/conv2d_1_input1']) like in this tutorial
Thomas
  • 676
  • 3
  • 18