如何解决 hls4ml 的这个问题?

如何解决如何解决 hls4ml 的这个问题?

我正在尝试运行示例代码 as shown on the documentation page of hls4ml,但在运行以下内容时:

import hls4ml

#Fetch a keras model from our example repository
#This will download our example model to your working directory and return an example configuration file
config = hls4ml.utils.fetch_example_model('KERAS_3layer.json')

print(config) #You can print it to see some default parameters

#Convert it to a hls project
hls_model = hls4ml.converters.keras_to_hls(config)

#Use Vivado HLS to synthesize the model
#This might take several minutes
hls_model.build()

#Print out the report if you want
hls4ml.report.read_vivado_report('my-hls-test')

输出是

Downloading example model files ...
{'OutputDir': 'my-hls-test','ProjectName': 'myproject','XilinxPart': 'xcku115-flvb2104-2-i','ClockPeriod': 5,'Backend': 'Vivado','IOType': 'io_parallel','HLSConfig': {'Model': {'Precision': 'ap_fixed<16,6>','ReuseFactor': '1'}},'KerasJson': 'KERAS_3layer.json','KerasH5': 'KERAS_3layer_weights.h5'}
Interpreting Model
Topology:
Layer name: input_1,layer type: InputLayer,current shape: [[None,16]]
Layer name: fc1_relu,layer type: Dense,16]]
Layer name: fc2_relu,64]]
Layer name: fc3_relu,32]]
Layer name: output_softmax,32]]
Creating HLS model
Synthesis report not found.
Found 1 solution(s) in my-hls-test/myproject_prj.
Reports for solution "solution1":

C SIMULATION RESULT:
INFO: [SIM 2] *************** CSIM start ***************
INFO: [SIM 4] CSIM will launch GCC as the compiler.
make: 'csim.exe' is up to date.
INFO: Unable to open input/predictions file,using default input.
0.0292969 0.756836 0.0546875 0.139648 0.0371094 
INFO: Saved inference results to file: tb_data/csim_results.log
INFO: [SIM 1] CSim done with 0 errors.
INFO: [SIM 3] *************** CSIM finish ***************

Synthesis report not found.
Co-simulation report not found.

请注意,最后两行是指构建过程和报告的返回。

我通过 Anaconda Navigator 在 Jupyter Notebook (6.0.3) 上运行它,Python 版本是 3.6.9,hls4ml 版本是 0.5.0

我无法理解这是由于安装还是代码等原因造成的错误。

对导致这种情况的原因有任何想法吗?


我认为这是特定于 hls4ml 的,但遗憾的是它在 StackOverflow 中不作为标签存在。

更新

我遇到的最初问题(即我的目录有一个空格 ' ',这是一个非法字符)让我运行 vivado_hls -f build_prj.tcl "csim=1 synth=1 cosim=1 export=1",这向我展示了一系列新问题。即,我收到这些错误:

***** C/RTL SYNTHESIS *****
INFO: [SCHED 204-61] Option 'relax_ii_for_timing' is enabled,will increase II to preserve clock frequency constraints.
INFO: [HLS 200-10] Analyzing design file 'firmware/myproject.cpp' ...
ERROR: [HLS 200-70] Compilation errors found: In file included from firmware/myproject.cpp:1:
In file included from firmware/myproject.cpp:19:
In file included from D:/Tools/Xilinx/Vivado/2019.2/win64/tools/clang/bin\..\lib\clang\3.1/../../../include/c++/4.5.2\iostream:39:
In file included from D:/Tools/Xilinx/Vivado/2019.2/win64/tools/clang/bin\..\lib\clang\3.1/../../../include/c++/4.5.2\ostream:39:
In file included from D:/Tools/Xilinx/Vivado/2019.2/win64/tools/clang/bin\..\lib\clang\3.1/../../../include/c++/4.5.2\ios:39:
In file included from D:/Tools/Xilinx/Vivado/2019.2/win64/tools/clang/bin\..\lib\clang\3.1/../../../include/c++/4.5.2\exception:151:
D:/Tools/Xilinx/Vivado/2019.2/win64/tools/clang/bin\..\lib\clang\3.1/../../../include/c++/4.5.2\exception_ptr.h:132:13: error: unknown type name 'type_info'
      const type_info*
            ^
In file included from firmware/myproject.cpp:1:
In file included from firmware/myproject.cpp:19:
In file included from D:/Tools/Xilinx/Vivado/2019.2/win64/tools/clang/bin\..\lib\clang\3.1/../../../include/c++/4.5.2\iostream:39:
In file included from D:/Tools/Xilinx/Vivado/2019.2/win64/tools/clang/bin\..\lib\clang\3.1/../../../include/c++/4.5.2\ostream:39:
In file included from D:/Tools/Xilinx/Vivado/2019.2/win64/tools/clang/bin\..\lib\clang\3.1/../../../include/c++/4.5.2\ios:39:
In file included from D:/Tools/Xilinx/Vivado/2019.2/win64/tools/clang/bin\..\lib\clang\3.1/../../../include/c++/4.5.2\exception:151:
D:/Tools/Xilinx/Vivado/2019.2/win64/tools/clang/bin\..\lib\clang\3.1/../../../include/c++/4.5.2\nested_exception.h:62:5: error: the parameter for this explicitly-defaulted copy constructor is const,but a member or base requires it to be non-const
    nested_exception(const nested_exception&) = default;
    ^
D:/Tools/Xilinx/Vivado/2019.2/win64/tools/clang/bin\..\lib\clang\3.1/../../../include/c++/4.5.2\nested_exception.h:64:23: error: the parameter for this explicitly-defaulted copy assignment operator is const,but a member or base requires it to be non-const
    nested_exception& operator=(const nested_exception&) = default;
                      ^
D:/Tools/Xilinx/Vivado/2019.2/win64/tools/clang/bin\..\lib\clang\3.1/../../../include/c++/4.5.2\nested_exception.h:77:28: error: exception specification in declaration does not match previous declaration
  inline nested_exception::~nested_exception() = default;
                           ^
D:/Tools/Xilinx/Vivado/2019.2/win64/tools/clang/bin\..\lib\clang\3.1/../../../include/c++/4.5.2\nested_exception.h:66:20: note: previous declaration is here
    inline virtual ~nested_exception();
                   ^
D:/Tools/Xilinx/Vivado/2019.2/win64/tools/clang/bin\..\lib\clang\3.1/../../../include/c++/4.5.2\nested_exception.h:122:61: error: redefinition of default argument
    __throw_with_nested(_Ex&& __ex,const nested_exception* = 0)
                                                            ^ ~
D:/Tools/Xilinx/Vivado/2019.2/win64/tools/clang/bin\..\lib\clang\3.1/../../../include/c++/4.5.2\nested_exception.h:110:56: note: previous definition is here
    __throw_with_nested(_Ex&&,const nested_exception* = 0)
                                                       ^ ~
In file included from firmware/myproject.cpp:1:
In file included from firmware/myproject.cpp:21:
In file included from firmware/myproject.h:23:
In file included from D:/Tools/Xilinx/Vivado/2019.2/common/technology/autopilot\ap_int.h:367:
In file included from D:/Tools/Xilinx/Vivado/2019.2/common/technology/autopilot\ap_fixed.h:55:
D:/Tools/Xilinx/Vivado/2019.2/common/technology/autopilot\ap_fixed_base.h:838:13: warning: shift count is negative [-Wshift-count-negative]
      ret.V <<= (_AP_I - _AP_W);
            ^   ~~~~~~~~~~~~~~~
D:/Tools/Xilinx/Vivado/2019.2/common/technology/autopilot\ap_fixed_base.h:869:69: note: in instantiation of member function 'ap_fixed_base<50,40,true,5,3,0>::to_ap_int_base' requested here
  inline __attribute__((always_inline)) int to_int() const { return to_ap_int_base().to_int(); }
                                                                    ^
D:/Tools/Xilinx/Vivado/2019.2/common/technology/autopilot\ap_fixed_base.h:1042:71: note: in instantiation of member function 'ap_fixed_base<50,0>::to_int' requested here
  inline __attribute__((always_inline)) operator int() const { return to_int(); }
                                                                      ^
firmware/nnet_utils/nnet_activation.h:389:17: note: in instantiation of member function 'ap_fixed_base<50,0>::operator int' requested here
   data_round = (data_cache[jj]-data_cache[ii])*CONFIG_T::table_size/16;
                ^
firmware/nnet_utils/nnet_activation.h:421:9: note: in instantiation of function template specialization 'nnet::softmax_legacy<ap_fixed<16,6,0>,ap_fixed<16,softmax_config9>' requested here
        softmax_legacy<data_T,res_T,CONFIG_T>(data,res);
        ^
firmware/myproject.cpp:90:5: note: in instantiation of function template specialization 'nnet::softmax<ap_fixed<16,softmax_config9>' requested here
    nnet::softmax<layer8_t,result_t,softmax_config9>(layer8_out,layer9_out);
    ^
In file included from firmware/myproject.cpp:1:
In file included from firmware/myproject.cpp:21:
In file included from firmware/myproject.h:23:
In file included from D:/Tools/Xilinx/Vivado/2019.2/common/technology/autopilot\ap_int.h:367:
In file included from D:/Tools/Xilinx/Vivado/2019.2/common/technology/autopilot\ap_fixed.h:55:
D:/Tools/Xilinx/Vivado/2019.2/common/technology/autopilot\ap_fixed_base.h:838:13: warning: shift count is negative [-Wshift-count-negative]
      ret.V <<= (_AP_I - _AP_W);
            ^   ~~~~~~~~~~~~~~~
D:/Tools/Xilinx/Vivado/2019.2/common/technology/autopilot\ap_fixed_base.h:869:69: note: in instantiation of member function 'ap_fixed_base<51,41,0>::to_ap_int_base' requested here
  inline __attribute__((always_inline)) int to_int() const { return to_ap_int_base().to_int(); }
                                                                    ^
D:/Tools/Xilinx/Vivado/2019.2/common/technology/autopilot\ap_fixed_base.h:1042:71: note: in instantiation of member function 'ap_fixed_base<51,0>::to_int' requested here
  inline __attribute__((always_inline)) operator int() const { return to_int(); }
                                                                      ^
firmware/nnet_utils/nnet_activation.h:401:27: note: in instantiation of member function 'ap_fixed_base<51,0>::operator int' requested here
      int exp_res_index = exp_res[ii]*CONFIG_T::table_size/64;
                          ^
firmware/nnet_utils/nnet_activation.h:421:9: note: in instantiation of function template specialization 'nnet::softmax_legacy<ap_fixed<16,layer9_out);
    ^
2 warnings and 5 errors generated.
Failed during preprocessing.
    while executing
"source build_prj.tcl"
    ("uplevel" body line 1)
    invoked from within
"uplevel \#0 [list source $arg] "

INFO: [Common 17-206] Exiting vivado_hls at Fri Apr  2 16:14:58 2021...

我在新版和旧版 Vivado HLS 上都遇到过这个问题。我该如何解决?

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams[&#39;font.sans-serif&#39;] = [&#39;SimHei&#39;] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -&gt; systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping(&quot;/hires&quot;) public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate&lt;String
使用vite构建项目报错 C:\Users\ychen\work&gt;npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-
参考1 参考2 解决方案 # 点击安装源 协议选择 http:// 路径填写 mirrors.aliyun.com/centos/8.3.2011/BaseOS/x86_64/os URL类型 软件库URL 其他路径 # 版本 7 mirrors.aliyun.com/centos/7/os/x86
报错1 [root@slave1 data_mocker]# kafka-console-consumer.sh --bootstrap-server slave1:9092 --topic topic_db [2023-12-19 18:31:12,770] WARN [Consumer clie
错误1 # 重写数据 hive (edu)&gt; insert overwrite table dwd_trade_cart_add_inc &gt; select data.id, &gt; data.user_id, &gt; data.course_id, &gt; date_format(
错误1 hive (edu)&gt; insert into huanhuan values(1,&#39;haoge&#39;); Query ID = root_20240110071417_fe1517ad-3607-41f4-bdcf-d00b98ac443e Total jobs = 1
报错1:执行到如下就不执行了,没有显示Successfully registered new MBean. [root@slave1 bin]# /usr/local/software/flume-1.9.0/bin/flume-ng agent -n a1 -c /usr/local/softwa
虚拟及没有启动任何服务器查看jps会显示jps,如果没有显示任何东西 [root@slave2 ~]# jps 9647 Jps 解决方案 # 进入/tmp查看 [root@slave1 dfs]# cd /tmp [root@slave1 tmp]# ll 总用量 48 drwxr-xr-x. 2
报错1 hive&gt; show databases; OK Failed with exception java.io.IOException:java.lang.RuntimeException: Error in configuring object Time taken: 0.474 se
报错1 [root@localhost ~]# vim -bash: vim: 未找到命令 安装vim yum -y install vim* # 查看是否安装成功 [root@hadoop01 hadoop]# rpm -qa |grep vim vim-X11-7.4.629-8.el7_9.x
修改hadoop配置 vi /usr/local/software/hadoop-2.9.2/etc/hadoop/yarn-site.xml # 添加如下 &lt;configuration&gt; &lt;property&gt; &lt;name&gt;yarn.nodemanager.res