`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. mongodb+express+nodejs(登陆退出)

    1.安装expressnpm i -g express(新版本4.X以上要安装express-generator)npm i -g express-generator 2.安装mongodb下载地址h ...

  2. mysql Access denied for user root @localhost (using password:YES)错误

    C:\AppServ\MySQL> mysql -u root -p Enter password:  ERROR 1045 (28000): Access denied for user 'r ...

  3. yml配置文件读取出错 Exception in thread "main" while scanning for the next token found character '\t(TAB)'

    这几天在学习springboot的微服务项目,在配置文件方面也想尝试下新的yml配置,就想把原来项目properties写的文件转换成yml试一下(老项目是之前检出在了eclipse里面),结果写好了 ...

  4. cron 配置

    一个cron表达式有至少6个(也可能7个)有空格分隔的时间元素. 按顺序依次为 秒(0~59) 分钟(0~59) 小时(0~23) 天(月)(0~31,但是你需要考虑你月的天数) 月(0~11) 天( ...

  5. 相似的RGB颜色——算法面试刷题3(for google),考察二分

    在本题中,每个大写字母代表从“0”到“f”的一些十六进制数字. 红绿蓝三元色#AABBCC可以简写为#ABC. 例如,#15c是颜色#1155cc的简写. 现在,假设两种颜色#ABCDEF和#UVWX ...

  6. Django 之 cookie和session

    一. Cookie 1.Cookie的由来 因为HTTP协议是无状态的,无状态的意思就是每次请求都是独立的,它的执行情况和结果与前面的请求和之后的请求都无直接关系,也不会受前后请求响应情况直接影响.简 ...

  7. '假定以下程序经编译和连接后生成可执行文件PROG.EXE,如果在此可执行文件所在目录的DOS提示符下键入:PROG ABCDEFGH IJKL<回车>,则输出结果为( ). void main( int argc, char *argv[]) { while(--argc>0) cout<<argv[argc]; cout<<"\n"; }

    main(int argc,char *argv[])函数的两个形参,第一个int argc,是记录你输入在命令行(你题目中说的操作就是命令行输入)上的字符串个数:第二个*argv[]是个指针数组,存 ...

  8. Webpack学习-Loader

    什么是Loader? 继上两篇文章webpack工作原理介绍(上篇.下篇),我们了解到Loader:模块转换器,也就是将模块的内容按照需求装换成新内容,而且每个Loader的职责都是单一,只会完成一种 ...

  9. ubuntu 系统开机执行脚本设置

    在ubuntu 系统中常常有一些操作需要开机时手动去执行,有一些固定的脚本文件可以通过改写启动项脚本让系统启动时自动执行 方法: 编辑/etc/下的rc.local脚本,把对应的需要执行的脚本写在ex ...

  10. js的事件流事件机制

    (1)冒泡型事件:事件按照从最特定的事件目标到最不特定的事件目标(document对象)的顺序触发. IE 5.5: div -> body -> document IE 6.0: div ...