完整报错如下:

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),相关推荐

  1. 【深度学习】empty() received an invalid combination of arguments - got (tuple, dtype=NoneType, device=None

    构建yoloV3的resblock时,python的一个小坑 在构建一个简单的卷积层时,出现如下的错误: 代码如下: class resblock(nn.Module):def __init__(se ...

  2. 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 ...

  3. 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 ...

  4. 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 ...

  5. 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 ...

  6. invalid number of arguments in root directive in

    从未见过如此厚颜无耻之人... 在windows上部署nginx,始终是报 invalid number of arguments in "root" directive in这个 ...

  7. 启动keepalived报错(VI_1): received an invalid passwd!

    1.打印日志: tail -f /var/log/messages 2.解决办法:修改配置文件中的:virtual_router_id参数,默认为51 ,修改为60,主从都要修改,保存退出 ! Con ...

  8. 【Swin-T onnx】swin transformer 转 onnx Error解决

    文章目录 1 文件和环境准备 2 Error_1 3 Error_2 4 Error_3 5 导出onnx模型.推理一张图片 参考链接 1 文件和环境准备 使用的是 霹雳吧啦 大神的GitHub代码: ...

  9. torch.mean

    自己测试的可以: import torchx=torch.arange(256).view(4,4,4,4).float() x_mean=torch.mean(x,axis=[2,3],keepdi ...

最新文章

  1. 一些mysql innodb的建议
  2. python使用imbalanced-learn的NeighbourhoodCleaningRule方法进行下采样处理数据不平衡问题
  3. C Primer Plus 第6章 C控制语句 6.16 编程练习及答案
  4. 5-django——验证码,中间件
  5. 第四天2017/03/31(下午2:结构体、数组)
  6. 电视盒子root_电视盒子 免root 去广告换桌面,20分钟还原干净清爽的桌面
  7. tomcat下manager配置
  8. Android“应用克隆”漏洞分析
  9. 如何提高英语听力(内容摘自NECCS)+ 乘法表
  10. chimerge算法matlab实现,有监督的卡方分箱算法
  11. Linux---有关dig命令的有用脚本
  12. 35岁程序员的独家面试经历
  13. Java 调用 pytorch_5分钟!用Java实现目标检测 | PyTorch
  14. Web程序设计(第三版)课后答案
  15. mysql世界国家省市地区的信息中英文
  16. 镁光闪存颗粒对照表_详解闪存颗粒的种类
  17. [转载] 白酒基础知识
  18. python3 chm文档下载_python3.7.0官方参考文档 最新api文档 chm_Python教程_源雷技术空间...
  19. jquery mobile_使用jQuery Mobile改善Web应用程序的安全性
  20. 组合两个表(外连接的使用)

热门文章

  1. 关闭windows或者windows server多用户会话
  2. [BMIm]BF4离子液体修饰的铜纳米粒子直径小于10nm
  3. AWK程序设计语言-翻译
  4. C++11 获取系统时间库函数 time since epoch
  5. Delphi--Delphi资源
  6. 安装Gearman及其PHP扩展
  7. 如何Tomcat部署web应用
  8. 新华都总裁兼CEO给唐骏留言
  9. 胡适说:他拍的是真正如画的北京
  10. 7-3 查找奥运五环色的位置 (25分)