Skip to content

FPGA Output is Zero in CNN model with 8,512 parameters.  #1048

Open
@zsrabbani

Description

@zsrabbani

I have a CNN model. I used the hls4ml and all file and bitfile generated completely. Now I used the deployment code to implement on FPGA(ZCU104), the prediction output of FPGA is always Zero.

Total params: 8512 (33.25 KB)
Trainable params: 8344 (32.59 KB)
Non-trainable params: 168 (672.00 Byte)

I will appreciate for helping me.

Here is the Model:

rf_in = Input(shape=(1024, 2), name = 'rf_input')

x = Conv1D(16, 7, activation=None, padding='same', use_bias=False)(rf_in)
x = BatchNormalization()(x)
x = Activation('relu')(x)
x = MaxPooling1D(2, strides = 2, padding='same') (x)

x = Conv1D(16, 7, activation=None, padding='same', use_bias=False)(x)
x = BatchNormalization()(x)
x = Activation('relu')(x)
x = MaxPooling1D(2, strides = 2, padding='same') (x)

x = Conv1D(16, 5, activation=None, padding='same', use_bias=False)(x)
x = BatchNormalization()(x)
x = Activation('relu')(x)
x = MaxPooling1D(2, strides=2, padding='same') (x)

x = Conv1D(16, 3, activation=None, padding='same', use_bias=False)(x)
x = BatchNormalization()(x)
x = Activation('relu')(x)
x = MaxPooling1D(2, strides=2, padding='same') (x)

x = Conv1D(8, 5, activation=None, padding='same', use_bias=False)(x)
x = BatchNormalization()(x)
x = Activation('relu')(x)
x = MaxPooling1D(2, strides=2, padding='same') (x)

x = Conv1D(8, 3, activation=None, padding='same', use_bias=False)(x)
x = BatchNormalization()(x)
x = Activation('relu')(x)
x = MaxPooling1D(2, strides=2, padding='same') (x)

x = Conv1D(4, 3, activation=None, padding='same', use_bias=False)(x)
x = BatchNormalization()(x)
x = Activation('relu')(x)
x = MaxPooling1D(2, strides=2, padding='same') (x)

x = Flatten()(x)

dense_1 = Dense(64, activation='relu', use_bias=False)(x)
dropout_1 = Dropout(0.35)(dense_1)
dense_2 = Dense(16, activation='relu', use_bias=False)(dropout_1)
dropout_2 = Dropout(0.55)(dense_2)
softmax = Dense(7, activation='softmax', use_bias=False)(dropout_2)

model = keras.Model(rf_in, softmax)
opt = keras.optimizers.Adam(learning_rate=0.001)
model.compile(loss='categorical_crossentropy', optimizer=opt, metrics=["accuracy"])

model.summary()

Here is the HLSML code:

image

Here s the deployment code:

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions