当前位置:网站首页>【PYTORCH】Expected object of type torch. xxxTensor but found type torch. cuda. xxxTensor(torch0.4.0)
【PYTORCH】Expected object of type torch. xxxTensor but found type torch. cuda. xxxTensor(torch0.4.0)
2022-06-13 07:43:00 【neu_ eddata_ yjzhang】
The above figure shows the whole content of the error , Among them, it is modified for us bug The useful part is
We can see from the picture , What we want layer(x,mask) Second parameter of ”mask“ Should be torch.ByteTensor Type instead of current torch.cuda.ByteTensor type . So we should put mask The type of is forcibly converted to torch.ByteTensor. That is, by modifying mask Of type To complete , The specific operation is as follows :
layer(x,mask.type(torch.ByteTensor)).
边栏推荐
- Redis learning journey -- subscription and publishing
- [log4j2 log framework] modify dump log file permissions
- QT reading SQLSERVER database
- v-for生成的子组件列表删除第n行出现数据错乱问题
- [log framework] add user-defined parameters to the MDC implementation log
- Redis underlying data structure -- listpack
- nodejs文件模块fs
- 6. system call
- Redis cluster parsing docker building redis cluster
- 25 | 冒险和预测(四):今天下雨了,明天还会下雨么?
猜你喜欢
Three handshakes and four waves of TCP protocol and why------ One two pandas
量化框架backtrader之一文读懂Analyzer分析器
Learning notes of balanced binary tree -- one two pandas
Selenium reports an error deprecationwarning: executable_ path has been deprecated, please pass in a Service object
21 | 面向流水线的指令设计(下):奔腾4是怎么失败的?
redis-6. Redis master-slave replication, cap, Paxos, cluster sharding cluster 01
23 | 冒险和预测(二):流水线里的接力赛
A learning dog
在排序数组中查找元素的第一个和最后一个位置
redis-4. Redis' message subscription, pipeline, transaction, modules, bloom filter, and cache LRU
随机推荐
Classification of databases
AQS - detailed explanation of reentrantlock source code
P6154 游走(记忆化搜索
One article of quantitative framework backtrader read analyzer
The management practice of leading enterprises has proved that what is the core of sustainable development of enterprises?
P7712 [Ynoi2077] hlcpq
在排序数组中查找元素的第一个和最后一个位置
Adding certificates to different systems
Selenium foundation API
QT读取SQLserver数据库
Redis underlying data structure -- listpack
Upgrade the project of log4j to log4j2
Tidb source code series: immersive compilation of tidb
26 | Superscalar和VLIW:如何让CPU的吞吐率超过1
Wechat applet - positioning, map display, route planning and navigation
redis-6. Redis master-slave replication, cap, Paxos, cluster sharding cluster 01
[MySQL] rapid data deletion recovery tool - binlog2sql
Redis learning journey - transaction
B. I hate 1111 (mnemonic search number theory
MySQL summary