当前位置:网站首页>empty() received an invalid combination of arguments - got (tuple, dtype=NoneType, device=NoneType),
empty() received an invalid combination of arguments - got (tuple, dtype=NoneType, device=NoneType),
2022-08-03 05:29:00 【WGS.】
完整报错如下:
TypeError: empty() received an invalid combination of arguments - got (tuple, dtype=NoneType, device=NoneType), but expected one of:
* (tuple of ints size, *, tuple of names names, torch.memory_format memory_format, torch.dtype dtype, torch.layout layout, torch.device device, bool pin_memory, bool requires_grad)
* (tuple of ints size, *, torch.memory_format memory_format, Tensor out, torch.dtype dtype, torch.layout layout, torch.device device, bool pin_memory, bool requires_grad)
参考自:https://blog.csdn.net/qq_25105061/article/details/123705011

说是不能是浮点型,所以这里定位到nn.Embedding的位置,feature_fields这个列表确实都是浮点型的,改成int类型即可
feature_fields = data_X.max().values + 1
feature_fields = feature_fields.astype(np.int)
print(feature_fields)
print(sum(feature_fields))
[ 2 2 2 2 2 2 2 2 2 2
2 2 2 869 525 117271 53414 210 13 9476
407 3 18942 4274 102028 2989 26 6932 82353 10
3192 1593 4 93248 15 14 21964 60 17029]
536887
边栏推荐
猜你喜欢

超全!9种PCB表面处理工艺大对比

PCB 多层板为什么都是偶数层?

【onnx 输入尺寸】修改pytorch生成的onnx模型的输入尺寸

WinServer2012r2破解多用户同时远程登录,并取消用户控制

【个人总结】MES系统开发/管理要点

Composer require 报错 Installation failed, reverting ./composer.json and ./composer.lock to their ...

在Zabbix5.4上使用ODBC监控Oracle数据库

5G网络入门基础--5G网络的架构与基本原理

ES 中时间日期类型 “yyyy-MM-dd HHmmss” 的完全避坑指南

Prometheus监控容器、pod、邮件告警
随机推荐
使用Contab调用Shell脚本执行expdp自动备份Oracle
MySQL的Replace用法详解
MySQL master-slave replication
BOA服务器移植之嵌入式开发板(FS4412)
Composer require 报错 Installation failed, reverting ./composer.json and ./composer.lock to their ...
ES6中 async 函数、await表达式 的基本用法
2021-06-14
Scala 高阶(七):集合内容汇总(上篇)
Redis的应用详解
Docker安装Mysql
一文读懂PCB品质体系认证
Command errored out with exit status 1类似问题解决方案
JDBC从手写连接到引用DBCP和C3P0
MySQL 数据库基础知识(系统化一篇入门)
SQL——左连接(Left join)、右连接(Right join)、内连接(Inner join)
ES6中 Symbol 的基础学习,迭代器和生成器的基本用法
数据库OracleRAC节点宕机处理流程
【Personal summary】Key points of MES system development/management
process.env环境变量配置方式(配置环境变量区分开发环境和生产环境)
Oracle 11g silent install