最近在研究Transformer在细粒度图像的应用,
解决 vit 源码的坑KeyError: 'Transformer/encoderblock_0/MultiHeadDotProductAttention_1/query\\kernel is not a file in the archive'这是os.path.join 合并路径的时候出现的问题解决方案:1.在modeling.py 文件里面下面这些路径后面加上'/':
ATTENTION_Q = "MultiHeadDotProductAttention_1/query/"
ATTENTION_K = "MultiHeadDotProductAttention_1/key/"
ATTENTION_V = "MultiHeadDotProductAttention_1/value/"
ATTENTION_OUT = "MultiHeadDotProductAttention_1/out/"
FC_0 = "MlpBlock_3/Dense_0/"
FC_1 = "MlpBlock_3/Dense_1/"
ATTENTION_NORM = "LayerNorm_0/"
MLP_NORM = "LayerNorm_2/"2.在vit_modeling_resnet.py 文件里面ResNetV2类 里面 每个'block'和'unit'后面加'/'self.body = nn.Sequential(OrderedDict([('block1/', nn.Sequential(OrderedDict([('unit1/', PreActBottleneck(cin=width, cout=width*4, cmid=width))] +[(f'unit{
i:d}/', PreActBottleneck(cin=width*4, cout=width*4, cmid=width)) for i in range(2, block_units[0] + 1)],))),('block2/', nn.Sequential(OrderedDict([('unit1/', PreActBottleneck(cin=width*4, cout=width*8, cmid=width*2, stride=2))] +[(f'unit{
i:d}/', PreActBottleneck(cin=width*8, cout=width*8, cmid=width*2)) for i in range(2, block_units[1] + 1)],))),('block3/', nn.Sequential(OrderedDict([('unit1/', PreActBottleneck(cin=width*8, cout=width*16, cmid=width*4, stride=2))] +[(f'unit{
i:d}/', PreActBottleneck(cin=width*16, cout=width*16, cmid=width*4)) for i in range(2, block_units[2] + 1)],))),
]))
详细解决方案
已解决:KeyError: ‘Transformer/encoderblock_0/MultiHeadDotProductAttention_1/query\\kernel is
热度:40 发布时间:2023-11-03 03:27:41.0
相关解决方案
- 大神们开始觅错啦!org.hibernate.exception.SQLGrammarException: could not execute query
- hibernate中Query query=session.createQuery的有关问题
- fatal error; call to a member function query() on a non-object异常求回答啊 php+sqlite
- 高人求解,关于<sql:query>标签解决办法
- hibernate Query.createQuery(queryString).list();查询最大只有1000条数据,该怎么处理
- hibernate query.list() 不执行解决方法
- could not execute query 错误
- query 剔除模糊属性
- nhibernate [could not execute query]错误
- 非常非常急敬请高手们帮忙!分在前两天都散光了!DB2数据库连接出现 SQL0666-Estimated query processing time 192 exceeds limit 30,该如何解决
- win9x kernel 16/32bit 混合的悲剧,该怎么解决
- kernel debugger解决办法
- kernel debugger,该怎么处理
- 求 详解 xml/Query 的资料。解决方案
- 数据库报错:Lost connection to MySQL server during query,该怎么处理
- 数据库报错:Lost connection to MySQL server during query,该如何解决
- MyEclipse+Hibernate连接MSSQL数据库总是could not execute query
- Hibernate条件查询(Criteria Query)
- mysql query error 看到csdn的查询语句了~解决办法
- CSS3 之传媒查询Media Query
- Fatal error: Call to a member function query() on a non-object in G:\wamp\apache,该如何解决
- dojo.query() 步骤常见的css选择符语法
- php用mysqli模块连数据库Fatal error: Call to a member function query() 。解决思路
- org.hibernate.NonUniqueResultException: query did not return a unique result: 二
- EXT-Ext.get() 跟 Ext.query() 组合使用实现最灵活的取元素方式
- ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)' 错误解决方法
- Query 容易实现select二级联动
- Ext 核心 API - Ext.query
- There is no Action 地图ped for action name query
- 【query】20个值得开发人员关切的jQuery技术博客