当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
MySQL之DQL——查询语言
流式低代码编程,拖拽节点画流程图并运行
mysql的配置文件(my.ini或者 my.cnf)所在位置
Redis哨兵模式+过期策略、淘汰策略、读写策略
xshell报错-要继续使用此程序,您必须应用最新的更新或使用新版本
2021-06-20
【干货分享】PCB 板变形原因!不看不知道
RADIUS计费认证如何配置?这篇文章一步一步教你完成
快速理解JVM+GC
mysql事务与多版本并发控制
VS Project Configuration Manager
UniApp 获取当前页面标题(navigationBarTitleText)
postman配置中文
5 个开源的 Rust Web 开发框架,你选择哪个?
Chrome 配置samesite=none方式
【入职第一篇知识总结- Prometheus】
Docker安装Mysql
PCB 多层板为什么都是偶数层?
【Markdown 数学公式】markdown常用公式写法
contos install php-ffmpeg and tp5.1 using plugin









