empty() received an invalid combination of arguments - got (tuple, dtype=NoneType, device=NoneType),
完整报错如下:
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 22 2 2 869 525 117271 53414 210 13 9476407 3 18942 4274 102028 2989 26 6932 82353 103192 1593 4 93248 15 14 21964 60 17029]
536887
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=None
构建yoloV3的resblock时,python的一个小坑 在构建一个简单的卷积层时,出现如下的错误: 代码如下: class resblock(nn.Module):def __init__(se ...
- TypeError: mean() received an invalid combination of arguments - got (list, dim=int), but expected o
TypeError: mean() received an invalid combination of arguments - got (list, dim=int), but expected o ...
- TypeError: norm() received an invalid combination of arguments解决办法
1.问题 使用pytorch中torch.nn.functional模块时,出现以下报错: 问题代码位于: mean, std = [0.485, 0.456, 0.406], [0.229, 0.2 ...
- 502 Proxy Error The proxy server received an invalid response from an upstream server
Proxy Error The proxy server received an invalid response from an upstream server. The proxy server ...
- ABOV E-PGM+提示 “No valid license” or “Received an invalid 32bit LOCTL
ABOV E-PGM+提示 "No valid license" or "Received an invalid 32bit LOCTL 1. Disconnect t ...
- invalid number of arguments in root directive in
从未见过如此厚颜无耻之人... 在windows上部署nginx,始终是报 invalid number of arguments in "root" directive in这个 ...
- 启动keepalived报错(VI_1): received an invalid passwd!
1.打印日志: tail -f /var/log/messages 2.解决办法:修改配置文件中的:virtual_router_id参数,默认为51 ,修改为60,主从都要修改,保存退出 ! Con ...
- 【Swin-T onnx】swin transformer 转 onnx Error解决
文章目录 1 文件和环境准备 2 Error_1 3 Error_2 4 Error_3 5 导出onnx模型.推理一张图片 参考链接 1 文件和环境准备 使用的是 霹雳吧啦 大神的GitHub代码: ...
- torch.mean
自己测试的可以: import torchx=torch.arange(256).view(4,4,4,4).float() x_mean=torch.mean(x,axis=[2,3],keepdi ...
最新文章
- 一些mysql innodb的建议
- python使用imbalanced-learn的NeighbourhoodCleaningRule方法进行下采样处理数据不平衡问题
- C Primer Plus 第6章 C控制语句 6.16 编程练习及答案
- 5-django——验证码,中间件
- 第四天2017/03/31(下午2:结构体、数组)
- 电视盒子root_电视盒子 免root 去广告换桌面,20分钟还原干净清爽的桌面
- tomcat下manager配置
- Android“应用克隆”漏洞分析
- 如何提高英语听力(内容摘自NECCS)+ 乘法表
- chimerge算法matlab实现,有监督的卡方分箱算法
- Linux---有关dig命令的有用脚本
- 35岁程序员的独家面试经历
- Java 调用 pytorch_5分钟!用Java实现目标检测 | PyTorch
- Web程序设计(第三版)课后答案
- mysql世界国家省市地区的信息中英文
- 镁光闪存颗粒对照表_详解闪存颗粒的种类
- [转载] 白酒基础知识
- python3 chm文档下载_python3.7.0官方参考文档 最新api文档 chm_Python教程_源雷技术空间...
- jquery mobile_使用jQuery Mobile改善Web应用程序的安全性
- 组合两个表(外连接的使用)