完整报错如下:

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. StaticFactoryMethod_Level4
  2. python3基础知识点总结_python基础知识点总结
  3. 让IE6、IE7、IE8支持CSS3的圆角、阴影样式
  4. JavaScript精简代码 非一般的写法(转载)
  5. 启动ipython出错_python-在异常情况下启动IPython shell
  6. java学习路线_java学习路线_我的入坑路
  7. make,makefile,cmake“暴力编译法”的个人经验或理解。
  8. [SoapUI] Jenkins 配置不同环境(TP, LIVE)
  9. VAE(变分自编码器)学习笔记
  10. 上架APPStore需要准备哪些材料?
  11. WinSock I/O 模型 -- OVERLAPPED I/O 模型
  12. C#LeetCode刷题之#485-最大连续1的个数(Max Consecutive Ones)
  13. Linux离线同步时间
  14. [设计模式-结构型]组合(Composite )
  15. 计算机毕业设计中基于python的快递查询系统
  16. android进程间传递文件描述符原理
  17. 常见算法之12---求a^n%p
  18. Python的Cython在Windows环境下的部署安装
  19. 再回首Java第二十二天
  20. 油猴(Tampermonkey)使用教程

热门文章

  1. 基于java web的学习平台-课程教学网站
  2. 望(dream-coastline 3.0)
  3. 以太坊-EVM第3部分——动态数据类型的表示方法
  4. 当flex的justify-content遇上overflow
  5. [HDU](6333)Problem B. Harvest of Apples ---- 数论+莫队算法
  6. pd.concat用法
  7. (附源码)springboot小说网站系统 毕业设计 041446
  8. 徐小平-机会就在每个同学手上-象牙塔内外精英的对话
  9. Qt Creator中调用Python的常见问题
  10. android软件工程师请进(说说自己公司的软件人员配置)