Dear HLS4ML help,
I defined a quantized CNN as follows:
model = Sequential()
model.add(QConv2D(filters=12, kernel_size=(3, 3), input_shape=(28, 28, 1),
kernel_quantizer=quantized_bits(q,0,alpha=1), bias_quantizer=quantized_bits(q,0,alpha=1),
kernel_initializer='lecun_uniform', kernel_regularizer=l1(0.0001)))
model.add(QActivation(activation=quantized_relu(q), name='relu1'))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Dropout(0.3))
model.add(Flatten())
model.add(QDense(10, name='output',
kernel_quantizer=quantized_bits(q,0,alpha=1), bias_quantizer=quantized_bits(q,0,alpha=1),
kernel_initializer='lecun_uniform', kernel_regularizer=l1(0.0001)))
model.add(Activation(activation='softmax', name='softmax'))
And adjust yml file as follows:
config = hls4ml.utils.config_from_keras_model(model, granularity='name')
config['Model'] = {'Precision' : 'ap_fixed<16,6>','ReuseFactor':2028, 'Strategy':'Resource'}
config['LayerName']['softmax']['exp_table_t'] = 'ap_fixed<12,8>'
config['LayerName']['softmax']['inv_table_t'] = 'ap_fixed<12,4>'
config['LayerName']['max_pooling2d']['Precision'] = 'ap_fixed<6,1>'
config['LayerName']['q_conv2d']['ReuseFactor'] = 54 #112
config['LayerName']['output']['ReuseFactor'] = 2028 #128
When I tried to compile hls_model, hls_model.compile(), I received the following error:
OSError: firmware/myproject-bE8FaBde.so: cannot open shared object file: No such file or directory
Would you please guide me how I could solve the problem?
Thanks in advance,
Regards,
--
Mahdieh Grailoo,
School of Electrical and Computer Engineering
University of Tehran
Email:
mgra...@ut.ac.ir