deep-learning 相关问题

深度学习是一个机器学习领域,其目标是使用“深层”(由多层组成)的特殊神经网络架构来学习复杂的功能。此标记应用于有关深度学习体系结构实现的问题。一般机器学习问题应标记为“机器学习”。包括相关软件库的标签(例如,“keras”或“tensorflow”)是有帮助的。

在哪里可以找到 YOLOv5 特征提取器?

我必须为学校项目定制 YOLOv5 特征提取器。克隆 YOLOv5 git 存储库后,我看到了一堆文件。但我不知道特征提取器在哪里。有人可以指导...

回答 2 投票 0

Fasttext 没有安装

无法 pip 安装 fasttext 此错误源自子进程,可能不是 pip 的问题。错误:legacy-install-failure × 尝试安装包时遇到错误。 ╰...

回答 0 投票 0

正确训练这个 Unet 模型的问题

所以我正在尝试训练一个 UNET 模型来从图像中分割人类。我正在使用回调,其中之一是 ReduceLROnPlateau 和 Early Stopping。然而,我的模型没有训练并停在了损失......

回答 0 投票 0

语义分割,如何合并多个类别的二值掩码?

语义分割,我需要合并多个类别的二值掩码,我应该怎么做?还需要他们的类别标签。 如何按像素值或其他方式排序和合并

回答 0 投票 0

在 tensrflow/keras 中测量深度神经网络的推理时间

我想在 tensprflow /keras 中使用 GPU/cpu 估计神经网络的推理时间。是否有一个公式/代码可以让您知道神经网络的 FLOPs 的推理时间......

回答 0 投票 0

AttributeError:“collections.OrderedDict”对象在 torch 的 dl 模型中没有属性“eval”

我在训练一个pytorch模型,保存方式如下: PATH = f"MODEL_trained.pt" torch.save(model.state_dict(), 路径) 然后当我想加载它并执行它时,我使用这个:

回答 0 投票 0

使用项目到项目协同过滤的课程推荐引擎

当我拥有的唯一数据集是课程详细信息时,如何创建引擎。最有可能的是,我如何使用深度学习来创建相似关系,以便当用户数据(课程和成绩 +

回答 0 投票 0

错误:要解压的值太多(预期为 3)

我目前正在构建一个模型,该模型已遵循许多项目中使用的步骤,但我遇到了太多值无法解压的问题,这是下面的代码 encoder_inputs = 输入(形状=(20,))...

回答 1 投票 0

训练过程后加载具有自定义损失函数的 coatnet 模型时出错

我在 TF 的 CoAtNet0 上做迁移学习, 首先,我从 keras_cv_attention_models.coatnet 加载模型, 具有自定义损失函数,并在几个时期后保存。 比我用...加载保存模型...

回答 0 投票 0

python 中的 Torch 无法获得某些层,例如从模型结构中添加

我有这个简单的代码来写下网络结构。 model = torch.jit.load('best5.torchscript') file_object = open('sample.txt', 'a') 对于名称,model.named_modules() 中的模块: 文件对象...

回答 1 投票 0

为什么我的 Numpy 数组显示为零,python

我的数据集由图像组成,有 3 个类。我的课程是“AD”、“MCI”和“CN”。在标记这些类别和我的图像时,我设置了 AD=1、MCI=2 和 CN=3,并将我的类别标签保存在 data_l 中...

回答 0 投票 0

如何使用 open cv 从图像中提取所有矩形或框

我有一张表格的图像。我将其作为来自另一个深度学习模型的输入。 这是图像: 我打算做的是使用 OpenCV 划分所有单元格,然后提取文本

回答 0 投票 0

自动编码器中的权重绑定

我正在尝试实施权重绑定以构建一个平衡的自动编码器。通过绑定权重,我希望解码器层使用编码器层的转置权重矩阵。采用了这种方法

回答 0 投票 0

如何使用yolov8进行图像分类训练?

根据分类的 YOLOV8 文档,这是使用 mnist 数据集的代码: 从 ultralytics 导入 YOLO 加载模型 model = YOLO('yolov8n-cls.yaml') # 从 YAML 构建一个新模型 米...

回答 0 投票 0

打破局部最小值的 pytorch CNN 分类器训练过程

我正在 PyTorch 中训练一个图像分类器,它应该将图像分类为 32 个具有相似大小的不同组。输出是一个单热向量,其中第 1 个条目代表选择的

回答 0 投票 0

使用 Tensorflow Addons 将 CRF 损失函数添加到 DNN 模型

我正在用 keras 在 python 中开发一个 DNN 模型,它有一个 CRF 层作为输出。由于不推荐使用 Keras-contrib,我正在尝试以这种方式使用 Tensorflow Addons CRF 层(doc): def get_model ...

回答 0 投票 0

卷积-LSTM 模型训练期间的 NaN 损失

以下模型的损失函数在训练期间爆炸。帮助调试将不胜感激! 定义 getModel(): num_minutes_in_timeseries = 1740 etd_num_features = 5 etd_input = keras.Input...

回答 0 投票 0

从 python 中的 torch 获取所有层,包括运算符

我想获得所有层,如卷积等...和运算符,如 python 中的“添加”,但我真的不知道如何。 这是我的代码 进口手电筒 # 你的模型的一个实例。 模型 = torch.jit...

回答 1 投票 0

TorchScript 需要源代码访问才能对 collections.deque 进行编译

我正在尝试将 PyTorch FOMM 模型转换为 TorchScript。一旦我开始使用 @torch.jit.script 注释一些类,我就遇到了一个错误: OSError:无法获取 的源代码 我正在尝试将 PyTorch FOMM 模型转换为 TorchScript。一旦我开始用@torch.jit.script注释一些类,我就得到了一个错误: OSError: Can't get source for <class 'collections.deque'>. TorchScript requires source access in order to carry out compilation, make sure original .py files are available. 据我所知,在 CPython 中实现的类因此不能被 TorchScript 编译器读取。我没有找到任何纯 Python 实现。我怎样才能克服这个问题? 这是我要注释的课程: import queue import collections import threading import torch @torch.jit.script class SyncMaster(object): """An abstract `SyncMaster` object. - During the replication, as the data parallel will trigger an callback of each module, all slave devices should call `register(id)` and obtain an `SlavePipe` to communicate with the master. - During the forward pass, master device invokes `run_master`, all messages from slave devices will be collected, and passed to a registered callback. - After receiving the messages, the master device should gather the information and determine to message passed back to each slave devices. """ def __init__(self, master_callback): """ Args: master_callback: a callback to be invoked after having collected messages from slave devices. """ self._master_callback = master_callback self._queue = queue.Queue() self._registry = collections.OrderedDict() self._activated = False def __getstate__(self): return {'master_callback': self._master_callback} def __setstate__(self, state): self.__init__(state['master_callback']) def register_slave(self, identifier): """ Register an slave device. Args: identifier: an identifier, usually is the device id. Returns: a `SlavePipe` object which can be used to communicate with the master device. """ if self._activated: assert self._queue.empty(), 'Queue is not clean before next initialization.' self._activated = False self._registry.clear() future = FutureResult() self._registry[identifier] = _MasterRegistry(future) return SlavePipe(identifier, self._queue, future) def run_master(self, master_msg): """ Main entry for the master device in each forward pass. The messages were first collected from each devices (including the master device), and then an callback will be invoked to compute the message to be sent back to each devices (including the master device). Args: master_msg: the message that the master want to send to itself. This will be placed as the first message when calling `master_callback`. For detailed usage, see `_SynchronizedBatchNorm` for an example. Returns: the message to be sent back to the master device. """ self._activated = True intermediates = [(0, master_msg)] for i in range(self.nr_slaves): intermediates.append(self._queue.get()) results = self._master_callback(intermediates) assert results[0][0] == 0, 'The first result should belongs to the master.' for i, res in results: if i == 0: continue self._registry[i].result.put(res) for i in range(self.nr_slaves): assert self._queue.get() is True return results[0][1] @property def nr_slaves(self): return len(self._registry) 将 TorchScript 生成方法从 torch.jit.script 切换到 torch.jit.trace 并且它有效,不需要注释任何东西。或者torch.onnx.export有时工作。 我在尝试在使用 torch 的 Python 脚本上使用 PyInstaller 时遇到了这个问题。我按照这个Github线程中的步骤3将标签更改为@torch.jit._script_if_tracing在modeling_deberta.py中。 (请注意,在 Github 的回答中,git clone 中有一个错字,其中说的是“变形金刚”而不是“变形金刚”,并且文件路径略有不同:src/transformers/models/deberta/modeling_deberta.py。我也在modeling_deberta_v2.py 中做到了为了安全。)

回答 2 投票 0

如何使用 Python 将各个列的值放入列表中

我有一个图像,它是表格的提取行,它看起来像这样: 我想将由垂直线分隔的每一列提取到一个列表中。 预期的输出将是这样的:...

回答 2 投票 0

© www.soinside.com 2019 - 2024. All rights reserved.