
tensorflow
文章平均质量分 60
shelleyHLX
这个作者很懒,什么都没留下…
展开
-
keras概述
1.关于Keras 1)简介 Keras是由纯python编写的基于theano/tensorflow的深度学习框架。 Keras是一个高层神经网络API,支持快速实验,能够把你的idea迅速转换为结果,如果有如下需求,可以优先选择Keras: a)简易和快速的原型设计(keras具有高度模块化,极简,和可扩充特性) b)支持CNN和RNN,或二者的结合 ...转载 2020-12-17 11:21:16 · 934 阅读 · 0 评论 -
indices[0] = [32, 2] does not index into param shape [1,4]
环境: tensorflow-2.3.0 , keras.函数tensorflow.gather_nd 的学习出现的额错误import tensorflow as tfimport numpy as npSIZE = 32INDEX = 2def build_model(): data_input = tf.keras.layers.Input(4,) index_input = tf.keras.layers.Input(2,) indices = tf.keras原创 2020-11-23 16:20:13 · 1798 阅读 · 3 评论 -
keras的图像预处理全攻略
keras的图像预处理全攻略(一)——基本的图像变换(Image Transform)方法https://blog.youkuaiyun.com/qq_27825451/article/details/90037062原创 2020-11-09 16:09:53 · 376 阅读 · 0 评论 -
keras自定义回调函数查看训练的loss和accuracy2020-11-05
前言:keras是一个十分便捷的开发框架,为了更好的追踪网络训练过程中的损失函数loss和准确率accuracy,我们有几种处理方式,第一种是直接通过 history=model.fit(),来返回一个history对象,通过这个对象可以访问到训练过程训练集的loss和accuracy以及验证集的loss和accuracy。第二种方式就是通过自定义一个回调函数Call backs,来实现这一功能,本文主要讲解第二种方式。一、如何构建回调函数Callbacks本文所针对的例子是卷积神经网...转载 2020-11-05 16:41:53 · 3678 阅读 · 5 评论 -
TF2.0模型创建--循环神经网络
1、通过tensorflow.keras.Sequential构造器创建模型import tensorflow as tffrom tensorflow.keras.layers import Dense, Flatten, Conv2D, Input, RNN, GRUCellfrom tensorflow.keras import Model, Sequentialfrom tensorflow.keras import layers"""rnn实现模型的写法:"""model原创 2020-11-05 16:16:24 · 427 阅读 · 0 评论 -
tf2的学习视频
深度学习与TensorFlow 2入门实战(完整版)链接:https://pan.baidu.com/s/1t9R4v1qAarEPOhX01svbRQ提取码:himg复制这段内容后打开百度网盘手机App,操作更方便哦–来自百度网盘超级会员V2的分享原创 2020-11-05 09:40:25 · 656 阅读 · 0 评论 -
TF2.0模型创建--卷积网络
TF2.0模型创建 概述 1、通过tensorflow.keras.Sequential构造器创建模型 2、使用函数式API创建模型 3、通过继承tensorflow.keras.Model类定义自己的模型 下一篇 TF2.0模型训练 概述这是TF2.0入门笔记【TF2.0模型创建、TF2.0模型训练、TF2.0模型保存】中第一篇【TF2.0模型创建】,本篇将介绍模型的创建。tensorflow2.0模型创建方法我划分为三种方式: 1、通过te...转载 2020-10-29 11:09:08 · 316 阅读 · 1 评论 -
tf2.2.0的错误
tensorflow.python.framework.errors_impl.InvalidArgumentError: Inputs to operation AddN of type AddN must have the same size and shape. Input 0: [4,1] != input 1: [] [Op:AddN]代码:# coding: utf-8import tensorflow as tfimport pandas as pdimport nu..原创 2020-10-23 11:52:14 · 412 阅读 · 0 评论 -
TypeError: Cannot convert 1.0 to EagerTensor of dtype int64
tensorflow2.2.0的错误:WARNING:tensorflow:The dtype of the source tensor must be floating (e.g. tf.float32) when calling GradientTape.gradient, got tf.int322020-10-19 17:18:38.582782: W tensorflow/core/framework/op_kernel.cc:1741] Invalid argument: TypeErro原创 2020-10-19 17:20:23 · 7788 阅读 · 2 评论 -
pip安装tensorflow的各个版本选择
$ pip install tensorflow-gpu==1.15.0Collecting tensorflow-gpu==1.15.0 Cache entry deserialization failed, entry ignored Could not find a version that satisfies the requirement tensorflow-gpu==1.15.0 (from versions: 0.12.0, 0.12.1, 1.0.0, 1.0.1, 1.1.0, ..原创 2020-09-29 10:26:45 · 5193 阅读 · 0 评论 -
ImportError: cannot import name ‘_validate_lengths‘
错误信息:Traceback (most recent call last):from skimage import ioFile "/home/Anconda3/envs/face_alignment/lib/python3.6/site-packages/skimage/__init__.py", line 167, in <module>from .util.dtype import (img_as_float32,File "/home/Anconda3/e.转载 2020-09-03 13:44:08 · 196 阅读 · 0 评论 -
keras中gru参数的计算方式的不同
旧版本:#coding=utf-8from keras import Model, Inputimport kerasfrom keras.layers import GRUimport tensorflow as tfprint(tf.__version__) # 1.13.1input = Input(shape=[10, 4])print(keras.__version__) # 2.2.4gru = GRU(5)(input)model = Model(input原创 2020-08-20 16:57:58 · 2042 阅读 · 2 评论 -
tensorflow2.0的常用函数使用
文章目录1. 预备1.1. 导入相应的包2. Tensor张量2.1. tf.zeros(shape)2.2. tf.ones_like(input) 根据已有变量,创建新的变量。2.2. tf.fill(dims, value)tf.random.normal(shape)tf.constant(value)1. 预备1.1. 导入相应的包import numpy as npimport matplotlib.pyplot as pltimport osimport pickleimport原创 2020-07-31 11:04:37 · 447 阅读 · 0 评论 -
tensorflow错误
could not create cudnn handle: CUDNN_STATUS_NOT_INITIALIZEDGetConvolveAlgorithms( conv_parameters.ShouldIncludeWinogradNonfusedAlgo<T>(), &algorithms)上面的错误是由于anacodna里的cuda和ubuntu里的cu...原创 2020-04-27 11:17:53 · 280 阅读 · 0 评论 -
'RefVariable' object has no attribute '_id'
tensorflow运行出现错误:AttributeError: 'RefVariable' object has no attribute '_id'导入包时加入tf.enable_eager_execution()搞定.原创 2020-02-26 14:59:46 · 4721 阅读 · 9 评论 -
tensorflow中的pad函数解释
from:说明:关于 tf.pad(...) 函数网上的解释和官网都让你看不懂,自己理解整理如下,希望可以帮到需要的人,以下内容只关注0扩展边界函数原型:tf.pad(input, paddings, name=None)input : 代表输入张量padding : 代表加的边界name : 代表此操作的名字官方的doc为: 可以访问 tensorflow API...转载 2018-11-19 11:08:40 · 347 阅读 · 0 评论 -
tensorlfow基础
a = [[[1, 3, 2, 2, 5, 23], [1, 3, 4, 6, 2 ,4], [1, 3, 4, 5, 6, 4], [1, 3, 4, 6, 2 ,4]], [[3,3 ,4, 3,3 ,2], [1, 3, 4, 6, 2 ,4], [3,2 ,3, 4, 3, 4], [6,2, 3, 3,2, 7]], [[3,3 ,4, 3,3 ,2], [1, 3, 4, 6, ...原创 2018-11-01 09:44:58 · 197 阅读 · 0 评论 -
tf.one_hot()使用
tf.one_hot在看conditionGAN的时候注意到label的输入要把它转换成one-hot形式,再与噪声z进行tf.concat输入,之前看的时候忽略了,现在再看才算明白为什么。tf.one_hot( indices,#输入,这里是一维的 depth,# one hot dimension. on_value=None,#output 默认1 of...转载 2018-08-14 10:22:43 · 1050 阅读 · 0 评论 -
tensorflow使用多个gpu训练
1. 模型并行概念: 模型并行指模型的不同部分在不同GPU上运行。单个模型过大无法在单个GPU上运行,这时候就需要model-parallelism.https://blog.youkuaiyun.com/tigertai98/article/details/81125307How to Use Distributed TensorFlow to Split Your TensorFlow Gra...原创 2018-12-27 14:01:36 · 5953 阅读 · 0 评论 -
variable与get_variable
Variabletensorflow中有两个关于variable的op,tf.Variable()与tf.get_variable()下面介绍这两个的区别tf.Variable与tf.get_variable()tf.Variable(initial_value=None, trainable=True, collections=None, validate_shape=True,ca...转载 2018-12-24 15:52:27 · 245 阅读 · 0 评论 -
TensorFlow优化器optimizer
论文An overview of gradient descent optimization algorithms介绍了算法原理,请参考这个博客相关原理。TensorFlow的相关实现包里相关的函数:Optimizer GradientDescentOptimizer AdagradOptimizer AdagradDAOptimizer MomentumOptimizer Ada...原创 2019-01-17 16:38:58 · 285 阅读 · 0 评论 -
TensorFlow的错误
TypeError: Input ‘y’ of ‘Pow’ Op has type float64 that does not match type int32 of argument ‘x’.这是由于赋值的常量要有小数点,比如learning_rate = 1是会出现错误要写learning_rate=1.0...原创 2019-01-17 17:04:07 · 169 阅读 · 0 评论 -
awesome-tensorflow
Awesome TensorFlow A curated list of awesome TensorFlow experiments, libraries, and projects. Inspired by awesome-machine-learning.What is TensorFlow?TensorFlow is an open source software librar...转载 2019-01-21 10:24:40 · 402 阅读 · 0 评论 -
tensorflow的向量操作
向量向量在编程语言中就是最常用的一维数组。二维数组叫做矩阵,三维以上叫做张量。向量虽然简单,高效,且容易理解。但是与操作0维的标量数据毕竟还是不同的。比如向量经常用于表示一个序列,生成序列像标量一样一个一个手工写就不划算了。当然可以用循环来写。在向量中这样还好,如果是在矩阵或者是张量中就强烈建议不要用循环来做了。系统提供的函数一般都是经过高度优化的,而且可以使用GPU资源来进行加速。我...转载 2018-11-21 10:13:12 · 3765 阅读 · 0 评论