def _upsample(self, x, y, scale=1):
        _, _, H, W = y.size()
        return F.interpolate(x, size=(H // scale, W // scale), mode='bilinear',align_corners=True)

转torchscript格式时报如下错误:

Expected a value of type 'Tensor (inferred)' for argument 'scale' but instead found type 'int'.
Inferred 'scale' to be of type 'Tensor' because it was not annotated with an explicit type.

你若果确实要传整型,改成

def _upsample(self, x, y, scale:int=1):
        _, _, H, W = y.size()
        return F.interpolate(x, size=(H // scale, W // scale), mode='bilinear',align_corners=True)

转torchscript报错:Expected a value of type ‘Tensor (inferred)‘ for argument ‘scale‘ but instead found t相关推荐

  1. golang 返回值报错 cannot use nil as type string in return argument

    在刚刚开始使用golang写代码的时候,经常会放错.给一个变量放回一个nil,这个通常编译的时候不会报错,但是运行是时候会报cannot use nil as type string in retur ...

  2. elasticsearch报错expected <block end>, but found BlockMappingStart解决方法

    elasticsearch报错expected , but found BlockMappingStart解决方法 参考文章: (1)elasticsearch报错expected , but fou ...

  3. clickhouse 报错 “Unmatched parentheses: (“ 或者报错 “Expected one of: CODEC, NULL, ALIAS, TTL, ClosingR

    环境 启动服务 docker run -d --name some-clickhouse-server --ulimit nofile=262144:262144 yandex/clickhouse- ...

  4. cesium解决DeveloperError报错‘Expected longitude to be typeof number, actual type of was string‘

    文章目录 1.出现问题 2.解决方法 2.1确定报错位置 2.2对症修改 Cesium实战系列文章总目录: 传送门 1.出现问题 背景:在进行Cesium项目开发时,将Cesium.js版本从压缩版本 ...

  5. 【C语言进阶】很诡异的编译报错expected declaration or statement at end of input

    作者简介 *架构师李肯(全网同名)**,一个专注于嵌入式IoT领域的架构师.有着近10年的嵌入式一线开发经验,深耕IoT领域多年,熟知IoT领域的业务发展,深度掌握IoT领域的相关技术栈,包括但不限于 ...

  6. [已解决]Object c,报错Expected method body

    Object c,报错Expected method body 原因分析:因为我将应该写在头文件Person.h的声明,写在和实现的Person.m文件中了 解决办法:将这些声明放在头文件Person ...

  7. 安装 sklearn 报错 ImportError: cannot import name Type

    1. 安装 sklearn sudo pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple sklearn 会默认安装 joblib , s ...

  8. SAP SD VL02N对STO的交货单执行PGI,报错 -Fld selectn for mvmt type 643 acct 400020 differs for Business Area –

    SAP SD VL02N对STO的交货单执行PGI,报错 -Fld selectn for mvmt type 643 acct 400020 differs for Business Area – ...

  9. SAP VLPOD 报错 - Update control of movement type is incorrect (entry 107 X X E B _ E) - 之对策

    SAP VLPOD 报错 - Update control of movement type is incorrect (entry 107 X X E B _ E) - 之对策 如下的DN 8002 ...

最新文章

  1. php 递归删除函数
  2. HDU 1225 覆盖的面积
  3. 已超过了锁请求超时时段。 (Microsoft SQL Server,错误: 1222)
  4. mono for android 使用Tab 控件
  5. idea中maven执行install报错_IntelliJ IDEA Maven编译install时报错,无效的发行版:1.8
  6. Django复习:创建与使用
  7. MPEG-4 压缩编码标准
  8. python自动化开发-[第十四天]-javascript(续)
  9. 一般人想象不到的创业者付出的5种努力 创业者的背后
  10. LaTex符号大全(LaTeX_Symbols)
  11. 脑洞大开!把 14 亿中国人拉到一个微信群 ?
  12. 条件期望与全期望公式
  13. 无线路由如何快速设置WDS扩展网络
  14. android属于数据库管理系统,详细谈谈Android系统中的SQLite数据库的应用
  15. Mybatis逆向工程同名表找错数据库的问题
  16. Java设计模式-结构型-门面模式
  17. 云平台与云主机选择的经验和建议
  18. 你告诉我,读书没有用
  19. javaee连接数据库出现错误
  20. Objective-c:内存管理

热门文章

  1. 日常(魔鬼本鬼又来了)
  2. DolphinDB Database丨交易回测系列一:技术信号回测
  3. 交易结算金额一致性保证
  4. 微型计算机外部设备接口,第五章 微型计算机输入输出接口
  5. python again_It’s really(wonder)________ to see you here again in Beijing.
  6. 360度全景标定方法_一种360度全视角鸟瞰全景行车辅助标定方法与流程
  7. 2017年国赛H题_远程幅频特性测试装置训练总结(硬件部分)
  8. Trading Convexity for Scalability
  9. 个人收藏夹 html,用h1和段落p 写一个三毛语录
  10. Codeforces--701B--Cells Not Under Attack