Open zsrabbani opened 3 days ago
I have a qkeras model. When I load model(load_qmodel) and I want to compile it I get this error. I installed the last version of HLS4ML libarary.
Code: model_path = 'weights-chkpt-11-0.657679.h5' model = load_qmodel(model_path) model.summary()
Result:
HLS Code: import hls4ml
hls_config = hls4ml.utils.config_from_keras_model(model, granularity='model') hls_config['Model']['ReuseFactor']=16 hls_config['Model']['Strategy']='Resource'
hls_config['LayerName']['output']['exp_table_t'] = 'ap_fixed<16,6>' hls_config['LayerName']['output']['inv_table_t'] = 'ap_fixed<16,6>' hls_config['LayerName']['output']['Strategy'] = 'Stable'
cfg = hls4ml.converters.create_config(backend='Vivado') cfg['IOType'] = 'io_stream' cfg['HLSConfig'] = hls_config cfg['KerasModel'] = model cfg['OutputDir'] = 'CNN_16_6_16_q' hls_model = hls4ml.converters.convert_from_keras_model(hls_config=cfg, backend='VivadoAccelerator', part='xczu7ev-ffvc1156-2-e')
hls_model.compile() print('NOW is finished')
I appreciate for your response.
I think this is fixed by #997. The model however is too large for hls4ml and won't work.
So because of large model I can not use the hls4ml?
I have a qkeras model. When I load model(load_qmodel) and I want to compile it I get this error. I installed the last version of HLS4ML libarary.
Code: model_path = 'weights-chkpt-11-0.657679.h5' model = load_qmodel(model_path) model.summary()
Result:
![image](https://github.com/fastmachinelearning/hls4ml/assets/37068372/bae2dbff-0663-4c2c-a724-e1fb1ed32d4d)
HLS Code: import hls4ml
hls_config = hls4ml.utils.config_from_keras_model(model, granularity='model') hls_config['Model']['ReuseFactor']=16 hls_config['Model']['Strategy']='Resource'
hls_config['LayerName']['output']['exp_table_t'] = 'ap_fixed<16,6>' hls_config['LayerName']['output']['inv_table_t'] = 'ap_fixed<16,6>' hls_config['LayerName']['output']['Strategy'] = 'Stable'
cfg = hls4ml.converters.create_config(backend='Vivado') cfg['IOType'] = 'io_stream'
cfg['HLSConfig'] = hls_config cfg['KerasModel'] = model cfg['OutputDir'] = 'CNN_16_6_16_q' hls_model = hls4ml.converters.convert_from_keras_model(hls_config=cfg, backend='VivadoAccelerator', part='xczu7ev-ffvc1156-2-e')
hls_model.compile() print('NOW is finished')
Result:
I appreciate for your response.