当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
【干货分享】PCB 板变形原因!不看不知道
Chrome 配置samesite=none方式
Use of Alibaba Cloud SMS Service (create, test notes)
SQLServer2019安装(Windows)
SVN账号配置权限
MySQL 操作语句大全(详细)
Monitoring Oracle11gR2 in Zabbix6.0 of OracleLinux8.6
UniApp 自定义条件编译详细使用流程
Oracle 数据库集群常用巡检命令
AQS、CAS、Synchronized小理解
2021-06-15
超全!9种PCB表面处理工艺大对比
MySQL的安装(详细教程)
ClickHouse 数据插入、更新与删除操作 SQL
TFS(AzureDevOps)取消离职人员的签出项
SVN客户端安装及操作文档
2021-06-15
ES6中 async 函数、await表达式 的基本用法
单节点部署 gpmall 商城系统(一)
JumpServer如何传输文件以及复制剪切板