![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
别致的人
这个作者很懒,什么都没留下…
展开
-
PackagesNotFoundError: The following packages are not available from current channels:报错解决
在新建conda环境的时候,报PacjagesNotFoundError,这个是因为渠道无法下载到这个提示的python3.6的包 我们只需要新增清华镜像源即可 conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ conda config --set show_channel_urls yes ...原创 2020-12-01 22:03:49 · 2240 阅读 · 0 评论 -
python方法:x.get_shape().as_list()
a_array = np.array([[1, 2, 3], [4, 5, 6]]) b_list = [[1, 2, 3], [3, 4, 5]] c_tensor = tf.constant([[1, 2, 3], [4, 5, 6]]) d=c_tensor.get_shape() e=d.as_list() print("a:",type(a_array)) print("b_list:",type(b_list)) print("c_tensor:",type(c_tensor)) print("原创 2020-11-25 11:28:22 · 1617 阅读 · 0 评论 -
报错:‘dict‘ object has no attribute ‘iteritems‘
因为字典中的iteritems方法是python2专有的,python3改成了items方法原创 2020-09-20 11:07:04 · 295 阅读 · 0 评论 -
范数小知识
L0范数是指向量中非0的元素的个数。(L0范数很难优化求解) L1范数是指向量中各个元素绝对值之和 L2范数是指向量各元素的平方和然后求平方根 L1范数可以进行特征选择,即让特征的系数变为0. L2范数可以防止过拟合,提升模型的泛化能力,有助于处理 condition number不好下的矩阵(数据变化很小矩阵求解后结果变化很大) (核心:L2对大数,对outlier离群点更敏感!) 下降速度:最小化权值参数L1比L2变化的快 模型空间的限制:L1会产生稀疏 L2不会。 L1会趋向于产生少量的特征,而其他的转载 2020-09-14 11:39:33 · 236 阅读 · 0 评论 -
numpy.random.normal()函数
numpy.random.normal(loc=0,scale=1e-2,size=shape) 参数解释: 1.参数loc(float):正态分布的均值,对应着这个分布的中心。loc=0说明这一个以Y轴为对称轴的正态分布, 2.参数scale(float):正态分布的标准差,对应分布的宽度,scale越大,正态分布的曲线越矮胖,scale越小,曲线越高瘦。 3.参数size(int 或者整数元组):输出的值赋在shape里,默认为None。 ...原创 2020-09-09 19:54:11 · 677 阅读 · 1 评论 -
导入keras数据集报错:ValueError: Object arrays cannot be loaded when allow_pickle=False
输入代码: (x_train,y_train),(x_test,y_test)=imdb.load_data(num_words=max_features) 报错: ValueError: Object arrays cannot be loaded when allow_pickle=False 分析原因: 自Numpy 1.16.3版本发行之后,函数 numpy.load() 和 numpy.lib.format.read_array() 采用allow_pickle关键字,现在默认为False。所原创 2020-09-09 10:00:15 · 157 阅读 · 0 评论 -
网络架构使用预训练的ImageNet参数报错ConnectionResetError: [WinError 10054]
在构建Inception V3、VGG19等网络架构的时候, from keras.applications import inception_v3 K.set_learning_phase(0)//因为我们不需要训练模型 model=inception_v3.InceptionV3(weights='imagenet',include_top=False) 运行这段代码报错: Downloading data from https://github.com/fchollet/deep-learning-原创 2020-09-04 14:41:51 · 242 阅读 · 0 评论 -
keras知识点(网络层和网络配置)
原创 2020-09-03 21:52:44 · 156 阅读 · 0 评论 -
python中numpy.random.randint()语法
语法: x=np.random.randint(min,max,size) 随机生成n个大于等于min,小于max的整数,数量为size个。 代码举例: import numpy as np print(np.random.randint(1, 10, 3)) print(np.random.randint(1, 100, 10)) 输出:原创 2020-08-21 10:42:02 · 929 阅读 · 0 评论