自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(27)
  • 收藏
  • 关注

原创 TypeError: ‘History‘ object is not subscriptable

画出神经网络模型的loss函数报错:TypeError: 'History' object is not subscriptable

2021-12-28 21:01:01 3684 1

转载 深入学习Keras中Sequential模型及方法 Sequential 序贯模型

深入学习Keras中Sequential模型及方法Sequential 序贯模型序贯模型是函数式模型的简略版,为最简单的线性、从头到尾的结构顺序,不分叉,是多个网络层的线性堆叠。Keras实现了很多层,包括core核心层,Convolution卷积层、Pooling池化层等非常丰富有趣的网络结构。我们可以通过将层的列表传递给Sequential的构造函数,来创建一个Sequential模型。123456789from keras.models import Sequential

2021-09-25 20:45:21 5121

原创 2021-09-18AttributeError: module ‘tensorflow‘ has no attribute ‘name_scope‘

这行显示报错,用的tensorflow2版本的,自己升级了,以前的就显示报错了,然后尝试加了tensorflow就可以了,更改如下:

2021-09-18 15:13:23 482

转载 ValueError: Error when checking target: expected dense_2 to have shape (1,) but got array with shape

ValueError: Error when checking target: expected dense_2 to have shape (1,) but got array with shape我遇到的错误:解决:

2021-09-16 09:37:20 1416 1

原创 AttributeError: ‘numpy.ndarray‘ object has no attribute ‘values‘

问题:AttributeError: ‘numpy.ndarray’ object has no attribute ‘values’解决:删掉" .values "。numpy升级到最新版本后就报了这个错了,尝试删除后就可以了。

2021-09-16 09:15:25 13043 5

转载 2021-09-16 报错AttributeError: ‘numpy.ndarray‘ object has no attribute ‘iloc‘

2021-09-16 09:11:41 2901

原创 python报错:IndexError: invalid index to scalar variable.

上述代码出现错误:“对标量变量来说是无效的索引”由于prediction_seqs是一维的,所以是索引下标不对修改为:

2020-10-11 10:57:33 27763

转载 python三维转二维的解决方法

2020-10-11 10:34:05 6648 5

转载 数据训练的时候出错:ValueError: Unknown label type: ‘continuous‘

解决方法: 使用.astype(‘int’) 将label转换为int型参考:https://blog.csdn.net/qq_41870817/article/details/89419726

2020-10-11 09:56:53 1252

转载 python 给图像加图例

2020-10-07 17:04:52 669

转载 python3将一维列表转换为多维列表(numpy+reshape)

在这里插入图片描述

2020-10-07 16:34:42 1909

转载 python3将多维数据转为一维

2020-10-07 15:46:18 1521

转载 MSE、MAE、RMSE的python实现

```pythontarget = [1.5, 2.1, 3.3, -4.7, -2.3, 0.75]prediction = [0.5, 1.5, 2.1, -2.2, 0.1, -0.5]error = []for i in range(len(target)): error.append(target[i] - prediction[i]) print("Errors: ", error)print(error)squaredError = []absError .

2020-10-06 20:47:44 3297 2

转载 python3 MSE实现

2020-10-06 20:32:06 824

转载 ValueError: Expected 2D array, got 1D array instead

转载:https://www.jianshu.com/p/788bc00e0671

2020-10-02 19:48:48 107

原创 DataFrame object has no attribute ‘as_matrix‘

pandas已经去掉了as_matrix()模块将df1.as_matrix()改为: df1.values参考文献:https://blog.csdn.net/xfei365/article/details/105128896

2020-09-26 19:16:48 2474 1

转载 ValueError: Expected 2D array, got scalar array instead

转载

2020-09-24 16:27:34 955

转载 Unknown projection ‘3d‘

python画图报错:Unknown projection ‘3d’(转载)加入from mpl_toolkits.mplot3d import Axes3D即可

2020-09-22 10:13:41 412

原创 TypeError: ‘module‘ object is not callable

模块导入错误,提示没有被请求模块函数,我这里是这个错了,修改:为:

2020-09-21 21:24:13 134

转载 TensorFlow中Variable V already exists, disallowed. Did you mean to set reuse=True in VarScope?

网上查找说是因为再次执行时,与已经存在的计算图发生冲突,需要加tf.reset_default_graph()我尝试了好多个地方,最后在main文件的第一句话加 成功解决更新:后来又出现这个问题了。。。我的文件包括main、数据处理和算法(类),最后在算法的class前加了这句又可以了我的算法自己进行了修改,所以是main多次导入不同的算法,会出错,建议每个算法放到不同的文件夹并配备一个对应的main函数...

2020-09-20 20:04:12 446

转载 AttributeError: module ‘tensorflow_core.compat.v1‘ has no attribute ‘contrib‘

initializer = tf.truncated_normal_initializer(stddev=0.1)

2020-09-19 20:57:04 4159

转载 tf.placeholder() is not compatible with eager execution的解决方法

tensorflow升级到2.1了,出现了如下错:RuntimeError: tf.placeholder() is not compatible with eager execution.这是因为在运行**tf.compat.v1.placeholder(dtype, shape = None, name = None)**的时候急切执行了这条语句,但是我们一般都是在一个Session前先去定义placeholder,但是不会去执行,然后再在Sesion上下文管理器中去传入我们的数据,然后执行。这里

2020-09-17 20:16:19 1611

原创 出现AttributeError: ‘NoneType‘ object has no attribute ‘columns‘这样的错

AttributeError: ‘NoneType’ object has no attribute ‘columns’出现这个错误是因为在此函数前面的一个函数没有写返回值忘记写返回值了 ,加上就好 了

2020-09-17 17:04:17 2746

原创 Keras requires TensorFlow 2.2 or higher

原因 keras 版本 太高以下是对应版本,将keras卸载,安装合适的即可

2020-09-13 20:28:32 7290 2

转载 Python 运行出现:pandas attribute error : no attribute ‘Factor‘ found解决方案(转载)

Python 运行出现:pandas attribute error : no attribute ‘Factor’ found解决方案(转载)一、遇到的问题## 标题博主在做随机森林的学习运行代码出现一下错误:from sklearn.datasets import load_irisfrom sklearn.ensemble import RandomForestClassifierimport pandas as pdimport numpy as np iris = load_iri

2020-09-11 10:43:26 331

原创 TypeError: __init__() got an unexpected keyword argument ‘n_iter‘

TypeError: init() got an unexpected keyword argument ‘n_iter’scikit-learn 官网介绍中写道:想要一个适合大规模的线性分类器,又不打算复制一个密集的行优先存储(C-order)双精度 numpy 数组作为输入, 那我们建议您去使用 SGDClassifier 类作为替代。该分类器的参数n_iter 在新版本中变成了n_iter_no_change官网显示参数如下:```pythonclass sklearn.linear_mo

2020-07-12 17:55:25 6893

转载 Python(TensorFlow框架)实现手写数字识别系统(转载)

转载自:https://blog.csdn.net/louishao/article/details/60867339###手写数字识别算法的设计与实现本文使用python基于TensorFlow设计手写数字识别算法,并编程实现GUI界面,构建手写数字识别系统。这是本人的本科毕业论文课题,当然,这个也是机器学习的基本问题。本博文不会以论文的形式展现,而是以编程实战完成机器学习项目的角度去描述。...

2020-06-01 22:24:46 574

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除