cost 68 ms
tensorflow 指标中的奇怪行为

[英]Weird behaviour in tensorflow metric

我创建了一个 tensorflow 指标,如下所示: 该指标添加到model.compile中,如下所示: 这应该在一半时间返回 0,在另一半时间返回 1。 因此,在训练我的 model 时,我应该看到该指标的值约为 0.5。 然而它始终为 0。 关于为什么的任何想法? ...

Tensorflow2 For循环图执行Valuerror

[英]Tensorflow2 For loop Graph Execution Valuerror

赏金将在 6 天后到期。 此问题的答案有资格获得+50声望赏金。 stander Qiu正在寻找一个规范的答案。 我正在使用 TF2 进行超参数优化。 例如,我定义了一个学习率范围lr= [0.0001, 0.001, 0.01]以传递给包含自定义训练循环(使用Gradientape )的Tra ...

Conv2D 过滤器和 CNN 架构

[英]Conv2D filters and CNN architecture

我目前正在攻读本科,我正在研究 CNN model 以识别 Telegu 字符。 这个问题有两个部分, 我有一个 (32,32,1) 形状的 Telegu 字符图像,我想训练我的 CNN model 来识别字符。 那么,我的 model 架构应该是什么以及如何确定架构、参数和隐藏层的数量。 我知道我 ...

keras evaluate() 使用最佳 model 不是最后 model

[英]keras evaluate() using best model not last model

我正在使用ModelCheckpoint save_best_only=True和EarlyStopping patience=5训练我的 model。 我使用我的测试数据进行验证。 当使用相同的测试数据和相同的回调应用evaluate()时,我得到与最后一个时期模型的val_指标相同的指标,而不 ...

如何在自定义训练tensorflow中编译保存model

[英]how to compile and save the model in custom training tensorflow

我尝试按照 tensorflow 教程编写自定义训练循环。 它给出了 output 如下 在自定义训练循环中,我不知道如何编译 model,根据以下标准保存最好的 model,例如“如果验证集上的损失未能减少或连续 10 个周期保持不变,则 model 将保存到 model .h5 文件,训练将停 ...

使用数据集 API 和 numpy 数组进行训练会产生完全不同的结果

[英]Training with Dataset API and numpy array yields completely different results

我有一个 CNN 回归 model,特征为(2000, 3000, 1)形状,其中 2000 是样本总数,每个样本都是 (3000, 1) 一维数组。 批量大小为 8,整个数据集的 20% 用于验证。 然而,zip 特征和 label 到tf.data.Dataset给出的分数与直接输入 numpy ...

根据 custom_training 循环中的标准保存最佳 model

[英]save the best model based on criteria in custom_training loop

我按照 tensorflow 教程编写了一个自定义训练循环。 无论如何它的培训和它产生 output 作为 在我不知道的自定义训练循环中,如何编译 model,保存最好的 model 基于“如果验证集上的损失未能减少或连续 10 个时期保持不变,则 model 将保存到 model.h5 文件和训 ...

LSTM 命名实体识别 model - 形状不兼容或逻辑/标签具有不同的尺寸 - Tensorflow 2.9

[英]LSTM named entity recognition model - shape are incompatible or logits/labels have different dimensions - Tensorflow 2.9

我正在处理 NLP LSTM 命名实体提取 model 但遇到不同的错误,下面是有关错误的更多详细信息。 我在木星笔记本中运行这段代码 Tensorflow 版本 2.9 input 和 output 的长度都是 50 输入句子:[123 88 170 221 132 52 105 32 211 ...

如何配置checkpoint和earlystopping不发出警告?

[英]How to configure checkpoint and earlystopping so that no warning will be issued?

我的 model 定义如下。 使用了两个回调。 我想监控 val_accuracy 并根据损失使用提前停止。 为什么总是抱怨“WARNING:tensorflow:Can save best model only with val_accuracy available, skipping.”? ...

部署 TensorFlow 概率回归 model 作为 Sagemaker 端点

[英]Deploy TensorFlow probability regression model as Sagemaker endpoint

我想在本地开发一个TensorFlow 概率回归 model并部署为 Sagemaker 端点。 我之前已经像这样部署了标准 XGB 模型,并且了解到可以像这样部署 TensorFlow model: 但是,我认为这不会涵盖例如依赖项: 我需要使用脚本模式还是 Docker? 任何指针将不胜感激。 ...

Tensorflow / CUDA:未检测到 GPU

[英]Tensorflow / CUDA: GPU not detected

我有两台配备 NVIDIA GeForce RTX 3060 GPU 的 Windows 11 笔记本电脑,我想在上面运行 Tensorflow。 如果这很重要,那么两台笔记本电脑都是 Lenovo Legion 5 笔记本电脑,“GPU 工作模式”设置为“混合自动模式”。 第一台笔记本电脑具有以 ...

Keras 保存完整时自定义图层出错 model

[英]Keras Custom Layer gives errors when saving the full model

此代码是一个错误的沙箱复制,该错误由具有 RESNet 101 主干的较大 Keras model 给出。 错误:如果 model 包含自定义层 ConstLayer: 没有这一行: config['x'] = self.x使用keras.models.load_model加载保存的 model ...

如何将掩蔽损失与 tensorflow2 TimeSeriesGenerator 结合起来

[英]How to combine a masked loss with tensorflow2 TimeSeriesGenerator

我们正在尝试使用卷积 LSTM 来预测给定过去 7 个时间步长的图像的值。 我们使用了 tensorflow2 TimeSeriesGenerator 方法来创建我们的时间序列数据: 每个图像(时间步长)都具有形状 (55, 50, 1),因此生成器生成了具有形状 (32, 7, 55, 50, 1 ...

numpy 和 tensorflow 学习中。 get_dummies 不工作

[英]numpy and tensorflow studying. get_dummies not working

我研究的是tensorflow,不是MNIST_small。 我将 notMNIST_small 下载到我的电脑上。 打印(indenpent.shape,sub.shape)#output:(18724,28,28,1)(18724,1) 但是,我认为它必须 (18724, 28, 28, 1) ...

TensorFlow M1 Pro Graph 执行错误

[英]TensorFlow on M1 Pro Graph Execution Error

我正在尝试使用带有金属加速的 tensorflow 在我的 Mac(操作系统版本 13.1)上训练 model,但是当我调用 .fit() 时,我不断收到以下错误: Python:3.10.8 TensorFlow:2.11.0 TensorFlow 金属:0.70 如果我使用 CPU 进行训练, ...

tensorflow v2 从头开始实现 Mini-batch gradient decent 错误

[英]Implementation of Mini-batch gradient decent from scratch with tensorflow v2 getting error

我正在尝试使用 google colab 中的 MNIST 数据集在 tensorflow v2 中从头开始实现 minibatch 梯度体面。 我收到以下我无法理解的错误。 为什么会出现以及可以在 tensorflow v2 中使用 google colab 实施的正确解决方案是什么。 我附上了我 ...


 
粤ICP备18138465号  © 2020-2023 STACKOOM.COM