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

【云原生 · Kubernetes】搭建Harbor仓库

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

Redis哨兵模式+过期策略、淘汰策略、读写策略

TFS (Azure conversation) prohibit people checked out at the same time

JUC并发编程深入浅出!

RADIUS计费认证如何配置?这篇文章一步一步教你完成

【EA Price strategy OC1】以实时价格为依据的EA,首月翻仓!】

el-tree设置选中高亮焦点高亮、选中的节点加深背景,更改字体颜色等

沉铜/黑孔/黑影工艺,PCB该 Pick 哪一种?

Composer require 报错 Installation failed, reverting ./composer.json and ./composer.lock to their ...
随机推荐
一家可靠的HDI板厂,需要具备哪些基本条件?
Nvidia NX使用向日葵远程桌面遇到的问题
MySQL的Replace用法详解
IDEA连接mysql又报错!Server returns invalid timezone. Go to ‘Advanced‘ tab and set ‘serverTimezone‘ prope
一文读懂PCB品质体系认证
Zabbix历史数据清理(保留以往每个项目每天一条数据)
Postman知识汇总
Oracle数据文件收缩_最佳实践_超简单方法
JumpServer如何传输文件以及复制剪切板
5 个开源的 Rust Web 开发框架,你选择哪个?
ES6中 async 函数、await表达式 的基本用法
在OracleLinux8.6的Zabbix6.0中监控Oracle11gR2
2021-06-20
php 数组元素移动
TFS(AzureDevOps)取消离职人员的签出项
ES6 - 剩余参数,Array的扩展方法,String的扩展方法
【OpenStack云平台】搭建openstack云平台
Shell脚本--信号发送与捕捉
C#程序默认以管理员权限打开
2021-06-15