`TypeError: torch.mm received an invalid combination of arguments - got (torch.FloatTensor, Variable), but expected one of:

    • (torch.SparseFloatTensor mat1, torch.FloatTensor mat2)
    • (torch.FloatTensor source, torch.FloatTensor mat2)

They can, but a function takes either Tensors or Variables as input but not a mix of them.
You should wrap your tensor into a Variable before using it.

不管是张量还是变量都行,但是混合的就不行。

参考:https://github.com/pytorch/pytorch/issues/1252

`TypeError: torch.mm received an invalid combination of arguments - got (torch.FloatTensor, Variable),的更多相关文章

  1. Received an invalid response. Origin 'null' is therefore not allowed access

    Received an invalid response. Origin 'null' is therefore not allowed access. 今天在做二级联动,使用ajax请求xml数据, ...

  2. 502 Proxy Error The proxy server received an invalid response from an upstream server

    Proxy Error The proxy server received an invalid response from an upstream server. The proxy server ...

  3. tengine2.2.3报错502的The proxy server received an invalid response from an upstream server问题处理

    tengine2.2.3报错502的The proxy server received an invalid response from an upstream server问题处理 现象:访问订单的 ...

  4. TypeError: Fetch argument 0 has invalid type <type 'int'>, must be a string or Tensor. (Can not convert a int into a Tensor or Operation.)

    6月5日的時候,修改dilated_seg.py(使用tensorflow)出現了報錯: TypeError: Fetch argument 0 has invalid type <type ' ...

  5. SqlBulkCopy 之 Received an invalid column length from the bcp client for colid 5.

    SqlBulkCopy 批量复制报错: Received an invalid column length from the bcp client for colid 5. 翻译:从bcp客户端收到一 ...

  6. TypeError: Fetch argument None has invalid type <type 'NoneType'>

    (fetch, type(fetch)))TypeError: Fetch argument None has invalid type <type 'NoneType'> 我的解决方案是 ...

  7. 启动keepalived报错(VI_1): received an invalid passwd!

    一.署keepalived后测试主down掉后无法自动切换到备 查看message日志一直报此错误 [root@lb-nginx-master ~]# tailf /var/log/messages ...

  8. keepalived启动后报错:(VI_1): received an invalid passwd!的解决办法

    一.配置好keepalived.conf文件后,启动keepalived,查看/var/log/message日志报错: [root@push-- sbin]# tail -f /var/log/me ...

  9. [nginx]invalid number of arguments

    invalid number of arguments nginx出现以下的错误,基本上错误的原因就是少了后面的分号导致. invalid number of arguments

随机推荐

  1. Devexpress中文语言包汉化

    1.下载对应版本的dev语音包 将语言包解压,放到如下文件夹,编译时会自动复制到bin目录下的. C:\Program Files (x86)\DevExpress 17.2\Components\B ...

  2. 使用Python创建一个简易的Web Server

    Python 2.x中自带了SimpleHTTPServer模块,到Python3.x中,该模块被合并到了http.server模块中.使用该模块,可以快速创建一个简易的Web服务器. 我们在C:\U ...

  3. APScheduler——定时任务框架

    https://www.cnblogs.com/luxiaojun/p/6567132.html

  4. JS-函数作用域

    如果变量在函数内没有声明(没有使用 var 关键字),该变量为全局变量.

  5. Java /C# 实现文件压缩

    纯粹为了记录. 参考了 https://www.cnblogs.com/zeng1994/p/7862288.html import java.util.List; import java.util. ...

  6. springboot自定义starter

    1,创建一个空工程 2,new一个Modules  ---------------- maven (启动器) : springboottest-spring-boot-starter 3,new一个M ...

  7. leetcode刷题——一些算法技巧总结1.0

    运算符优先级,简单记就是:! > 算术运算符 > 关系运算符 > && > || > 赋值运算符 把数字取反,可以作为一种标记 pythonlast = ...

  8. 使用npm私有服务器保存公司内部强业务类型组件(一):npm私有服务器搭建

    1:安装centOS虚拟机 2:安装完成虚拟机后完成后开启系统网卡: 进入到/etc/sysconfig/network-scprits/ 打开ifcfg-ens33文件 找到 ONBOOT=NO 改 ...

  9. vim搜索及高亮取消

    1. 命令模式下,输入:/字符串 比如搜索user, 输入/user 按下回车之后,可以看到vim已经把光标移动到该字符处和高亮了匹配的字符串 2. 查看下一个匹配,按下n(小写n) 3. 跳转到上一 ...

  10. php 类名和方法名相同(构造函数)

    //php 5.6class father{ public function __construct() { echo __METHOD__; }} class son extends father{ ...