当前位置:网站首页>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
边栏推荐
猜你喜欢

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

【multi_scale】多尺度训练——目标检测训练trick

流式低代码编程,拖拽节点画流程图并运行

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

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

MySQL的on duplicate key update 的使用

MySQL的DATE_FORMAT()函数将Date转为字符串

MySql之json_extract函数处理json字段

PostMan测试接口-----上传文件、导出excel

Use of Alibaba Cloud SMS Service (create, test notes)
随机推荐
cookie和session区别
【nohup】nohup命令的简单使用
【IoU loss】IoU损失函数理解
【地平线 开发板】实现模型转换并在地平线开发板上部署的全过程操作记录(魔改开发包)
MySQL的安装教程(嗷嗷详细,包教包会~)
MySql的安装配置超详细教程与简单的建库建表方法
界面仅允许扫码枪录入禁止手工键盘输入
【dllogger bug】AttributeError: module ‘dllogger‘ has no attribute ‘StdOutBackend‘
AR路由器如何配置Portal认证(二层网络)
MySQL的10种常用数据类型
postman配置中文
C#切换输入法
JumpServer如何传输文件以及复制剪切板
【个人总结】MES系统开发/管理要点
快速理解JVM+GC
ClickHouse 数据插入、更新与删除操作 SQL
如何使用md5码验证文件的一致性
ES6中 Symbol 的基础学习,迭代器和生成器的基本用法
2021-06-14
【multi_scale】多尺度训练——目标检测训练trick