fastmachinelearning / hls4ml

Machine learning on FPGAs using HLS
https://fastmachinelearning.org/hls4ml
Apache License 2.0
1.27k stars 409 forks source link

convert_from_keras_model with project_name set to nondefault value fails to build #624

Open jmitrevs opened 2 years ago

jmitrevs commented 2 years ago

Prerequisites

Please make sure to check off these prerequisites before submitting a bug report.

Quick summary

convert_from_keras_model with project_name set to nondefault value fails to build, because in build.tcl the variable ${mynewprojname} is not defined. I will look to fix this, so just adding issue to not forget.

Details

If I set project_name to a non_default value, e.g.:

hls_model = hls4ml.converters.convert_from_keras_model(model,
                                                       hls_config=config,
                                                       output_dir='model_1_copy/hls4ml_prj',
                                                       part='xcu250-figd2104-2L-e',
                                                       project_name="mynewmodel")

in the hls4ml-tutorial (part 1), the build strep produces:

Sourcing Tcl script 'build_prj.tcl'
can't read "mynewmodel": no such variable
    while executing
"open_project ${mynewmodel}_prj"
    invoked from within
"if {$opt(reset)} {
  open_project -reset ${mynewmodel}_prj
} else {
  open_project ${mynewmodel}_prj
}"
    (file "build_prj.tcl" line 151)
    invoked from within
"source build_prj.tcl"
    ("uplevel" body line 1)
    invoked from within
"uplevel \#0 [list source $arg] "

Please add to the following sections to describe the bug as accurately as possible.

Steps to Reproduce

The description above describes the change to part 1 of the hls4ml-tutorial that is legal but causes the project to not build