问题描述

使用Tinynn将Pytorch转化为tflite时报错:

发生异常: TracingCheckError       (note: full exception trace is shown but execution is paused at: _run_module_as_main)
Tracing failed sanity checks!
ERROR: Graphs differed across invocations!
Graph diff:
graph(%self.1 : __torch__.model.Musicnn_NPU,
%x.1 : Tensor):
%dense2 : __torch__.torch.nn.modules.linear.Linear = prim::GetAttr[name="dense2"](%self.1)
.............
First diverging operator:
Node diff:
- %dense2 : __torch__.torch.nn.modules.linear.___torch_mangle_64.Linear = prim::GetAttr[name="dense2"](%self.1)
? ^
+ %dense2 : __torch__.torch.nn.modules.linear.___torch_mangle_143.Linear = prim::GetAttr[name="dense2"](%self.1)
?

这个错误是指追踪(Tracing)过程中的健全性检查(sanity checks)失败。

ERROR: Graphs differed across invocations!:错误表明在不同的调用(invocations)中,计算图(Graphs)不一致。

First diverging operator::指出了导致计算图出现差异的第一个操作符(operator)。

原因以及解决方法

模型中包含随机操作(如dropout或随机初始化),每次执行时可能会产生不同的结果,导致计算图不一致,如我使用的模型:

        out = self.relu(self.bn(self.dense1(out)))
out = self.dropout(out)
out = self.dense2(out)
# out = nn.Sigmoid()(out)
# [ruihai.jing]module changed cause of quantized error--start
out = nn.functional.sigmoid(out)

第一个报错的层在self.dense2(out),因为上面有dropout操作,把这个操作注释掉就可以。

Jit 报错TracingCheckError:ERROR: Graphs differed across invocations!的更多相关文章

  1. JS function document.onclick(){}报错Syntax error on token "function", delete this token

    JS function document.onclick(){}报错Syntax error on token "function", delete this token func ...

  2. 一个参数大小写引发的uploadify报错 "Syntax error, unrecognized expression: #"

     上传控件uploadify 报错"Syntax error, unrecognized expression: #" 版本为 uploadify3.2  报错原因:参数ID[hi ...

  3. yum报错:Error: xz compression not available

    测试服务器(centos6.5)经过一段时间的折腾,有一天在上面进行yum操作时突然出现下面的报错: Error: xz compression not available 最后经过一番排查,发现原因 ...

  4. yum报错: Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again

    在Centos 5.x或6.x上安装RHEL EPEL Repo repository,资源库,源的意思.RHEL EPEL(Extra Packages for Enterprise Linux)  ...

  5. redis报错Windows error 0x70(a large memory)

    redis报错Windows error 0x70 redis 嫌弃你内存不够了,就给你不开第二个实例. The Windows version of Redis allocates a large ...

  6. ASSERT报错:error C2664: “AfxAssertFailedLine”: 不能将参数 1 从“TCHAR []”转换为“LPCSTR”

    转载请注明来源:崨雁嫀筝 http://www.cnblogs.com/xuesongshu 这个错误是我在把tinyxml修改为宽字符(Unicode)版本时候遇到的问题,我首先按关键字把所有有ch ...

  7. 启动安卓模拟器报错 emulator: ERROR: x86_64 emulation currently requires hardware acceleration! CPU acceleration status:HAXM must be updated(version 1.1.1<6.0.1) 解决办法

    启动安卓模拟器报错 emulator: ERROR: x86_64 emulation currently requires hardware acceleration!  CPU accelerat ...

  8. sql查询语句报错处理——ERROR: failed to find conversion function from unknown to text

    今天遇到写存储过程遇到的一个小问题,在查询语句中使用到了自定义的数当做列的值,然后想给这一列起一个别名 ,就直接在后面用了 as 别名.执行存储过程,存储过程报错,ERROR: failed to f ...

  9. SOAPtest报错:error occurred during initialization of vm解决方法

    参考:http://forums.parasoft.com/index.php?act=ST&f=36&t=614 安装SOAPtest报错:error occurred during ...

  10. 安装 R 包报错 clang: error: unsupported option '-fopenmp' 的解决方法

    MacOS 上安装 R 包 install.packages("data.table") 后面提示是否安装需要编译的版本: Do you want to install from ...

随机推荐

  1. 使用Shader画常见的数学函数

    使用Shader画常见的数学函数 本篇博文的灵感来自于Shader Books这一小节:https://thebookofshaders.com/05/?lan=ch 代码运行网站:http://ed ...

  2. 【数据结构与算法】第K大的元素:三路快速排序算法思路

    第K大的元素:三路快速排序算法思路 Java https://leetcode-cn.com/problems/kth-largest-element-in-an-array/solution/di- ...

  3. 详细介绍java的线程池状态

    一.详细介绍java的线程池状态 Java 中的线程池状态是 ThreadPoolExecutor 类内部管理的一个重要概念.线程池的状态决定了线程池的行为,例如是否接受新任务.是否处理队列中的任务. ...

  4. 自动驾驶仿真全攻略:基于CARLA+YOLOv5的自主导航实战

    引言:自动驾驶仿真的战略价值 在自动驾驶技术落地的前夜,仿真测试正在成为连接算法研发与实际路测的关键桥梁.据统计,自动驾驶系统每1万公里的接管次数需从仿真测试的百万公里级数据中优化,这使得CARLA. ...

  5. DPDI(Dispatch PDI)kettle调度管理平台之实操演练第001讲--手工调度本地PDI任务生成日期维度数据

    DPDI实操演练第一讲 1.DPDI简介 DPDI Online 您的智能ETL任务调度专家 DPDI Online 是一款基于Kettle的强大在线任务调度平台,凭借其高效与灵活性,专为调度和监控K ...

  6. kettle+report designer导出带样式的excel包含多个sheet页

    场景介绍: 运用pentaho report designer报表设计器,查询数据库字典表生成带有样式的excel,通过kettle pentaho报表输出组件导出形成数据字典,最终形成的数据字典样式 ...

  7. RK356X网口限速

    1. 参考资料 Linux 上的虚拟网络接口,主要要了解一下 IFB,对输入的流量进行整形 https://lyyao09.github.io/2020/06/13/linux/An-introduc ...

  8. lighttools batchmode 批处理vb程序代码

    完成后的图示,选择需要模拟的lighttools后,直接进行运行,点击开始模拟,即可逐个模拟完成 lighttools 连接代码: 1 Private m_ltServer As LTAPI 2 3 ...

  9. 测试获取 Github 信息

    import json import requests from .fetch_github_info import AUTHENTICATED_USER_ENDPOINT, fetch_github ...

  10. <HarmonyOS第一课05>从简单的页面开始

    ArkUI是HarmonyOS应用的UI开发框架,它提供了一套完整的基础设施,包括简洁的UI语法.丰富的UI功能(组件.布局.动画以及交互事件),以及实时界面预览工具等.ArkUI支持开发者进行可视化 ...