成功解决UserWarning: Update your `Conv2D` call to the Keras 2 API问题

简介: 成功解决UserWarning: Update your `Conv2D` call to the Keras 2 API问题

解决问题

 

sklearn\utils\validation.py:578: DataConversionWarning: A column-vector y was passed when a 1d array was expected. Please change the shape of y to (n_samples, ), for example using ravel().

y = column_or_1d(y, warn=True)

 

 

 

解决思路

 

数据转换警告:当需要一维数组时,传递了列向量y。请将Y的形状更改为(n_samples,),例如使用ravel()。

y = column_or_1d(y, warn=True)

 

 

 

解决方法

 

该问题是警告信息,不处理亦可运行程序,只需理解一下即可!建议以后使用此类方法,要规范使用!毕竟,语言编程是比较严谨的!因为查bug的时候很痛苦,你懂的!

 

相关文章
|
Shell
wandb.errors.UsageError: api_key not configured (no-tty). call wandb.login(key=[your_api_key])
wandb.errors.UsageError: api_key not configured (no-tty). call wandb.login(key=[your_api_key])
4415 0
wandb.errors.UsageError: api_key not configured (no-tty). call wandb.login(key=[your_api_key])
|
机器学习/深度学习 API 算法框架/工具
【Tensorflow+keras】Keras API三种搭建神经网络的方式及以mnist举例实现
使用Keras API构建神经网络的三种方法:使用Sequential模型、使用函数式API以及通过继承Model类来自定义模型,并提供了基于MNIST数据集的示例代码。
216 12
|
机器学习/深度学习 API 算法框架/工具
【Tensorflow+keras】Keras API两种训练GAN网络的方式
使用Keras API以两种不同方式训练条件生成对抗网络(CGAN)的示例代码:一种是使用train_on_batch方法,另一种是使用tf.GradientTape进行自定义训练循环。
196 5
|
TensorFlow API 算法框架/工具
【Tensorflow 2】Keras API+Estimator的使用
本文介绍了在TensorFlow 2中结合Keras API和Estimator API来构建和训练模型的方法,并提供了一个示例流程,包括构建模型、生成数据集、使用Estimator进行训练以及评估模型性能。
153 3
|
API 算法框架/工具
【Tensorflow+keras】使用keras API保存模型权重、plot画loss损失函数、保存训练loss值
使用keras API保存模型权重、plot画loss损失函数、保存训练loss值
211 0
|
机器学习/深度学习 TensorFlow API
Keras是一个高层神经网络API,由Python编写,并能够在TensorFlow、Theano或CNTK之上运行。Keras的设计初衷是支持快速实验,能够用最少的代码实现想法,并且能够方便地在CPU和GPU上运行。
Keras是一个高层神经网络API,由Python编写,并能够在TensorFlow、Theano或CNTK之上运行。Keras的设计初衷是支持快速实验,能够用最少的代码实现想法,并且能够方便地在CPU和GPU上运行。
|
API Python
记录openai官网关于Setup your API key for a single project(为单个项目设置API 可以)的错误(2023/11/24)
记录openai官网关于Setup your API key for a single project(为单个项目设置API 可以)的错误(2023/11/24)
580 0
|
机器学习/深度学习 TensorFlow API
【计算机视觉】Keras API和Tensorflow API的讲解(超详细必看)
【计算机视觉】Keras API和Tensorflow API的讲解(超详细必看)
253 1
|
机器学习/深度学习 人工智能 API
人工智能应用工程师技能提升系列2、——TensorFlow2——keras高级API训练神经网络模型
人工智能应用工程师技能提升系列2、——TensorFlow2——keras高级API训练神经网络模型
165 0
|
API Python Windows
[已解决] openai.error.AuthenticationError: No API key provided. You can set your API key in code using
[已解决] openai.error.AuthenticationError: No API key provided. You can set your API key in code using
921 0