当前位置:网站首页>Failed to convert a NumPy array to a Tensor(Unsupported Object type int)
Failed to convert a NumPy array to a Tensor(Unsupported Object type int)
2022-04-23 07:42:00 【异二次元】
错误如下,说明模型不支持Object类型(非数值类型)的数据,所以需要讲Object类型的数据采用独热编码,或者自己进行预编码,代码如下:
import pandas as pd
data=pd.read_csv("test.csv")
for features in data.columns:
if data[features].dtype == 'object':
data[features] = pd.Categorical(data[features]).codes
版权声明
本文为[异二次元]所创,转载请带上原文链接,感谢
https://blog.csdn.net/weixin_43694829/article/details/124237102
边栏推荐
猜你喜欢
ATSS(CVPR2020)
MySQL数据库中delete、truncate、drop原理详解
关于ORB——SLAM运行中关键帧位置越来越近的异常说明
PyQt5开发之QTableWidget表头自定义与美化(附源代码下载)
Somme numérique de la chaîne de calcul pour un problème simple de leetcode
通过实现参数解析器HandlerMethodArgumentResolver接口来自定义注解
There are some problems when using numeric type to query string type fields in MySQL
Briefly describe the hierarchical strategy of memory
Rotation function of leetcode medium problem
Samsung, March to the west again
随机推荐
The annotation is self-defined by implementing the parameter parser handlermethodargumentresolver interface
怎么读书读论文
2022.4.11-4.17 AI行业周刊(第93期):AI行业的困局
万物互联下如何对设备进行加密
excle加水印
Comparison of indoor positioning technology
An example of network communication based on TCP / IP protocol -- file transmission
Briefly describe the hierarchical strategy of memory
QT compilation qtxlsx Library
Green apple film and television system source code film and television aggregation film and television navigation film and television on demand website source code
使用JWT生成与解析Token
二维01背包
redis主从服务器问题
The simple problem of leetcode is to calculate the numerical sum of strings
MySQL数据库中delete、truncate、drop原理详解
网赚APP资源下载类网站源码
The third divisor of leetcode simple question
Qt利用QtXlsx操作excel文件
nn.Module类的讲解
Ansible Automation Operation and Maintenance details (ⅰ) Installation and Deployment, Parameter use, list Management, Profile Parameters and user level ansible operating environment Construction