作为项目的一部分,我想研究颜色对 CNN 的作用/影响。不幸的是,到目前为止我发现的信息很少,如果您对我有任何文献建议,我希望收到您的来信。
基本上我想研究颜色对 CNN 的影响方式、原因和影响。为什么我应该使用具有 3 个通道的图像,而不是仅使用一个通道的图像。
此外,我想研究色彩空间的影响,我找到了一篇论文,但也许其中一个知道其他有用的文献。
您知道我如何才能最好地进行这项调查吗?
我思考过以下问题:
--
对于第二个问题(色彩空间),我将进行类似的处理。
我走在正确的轨道上吗?您对如何更好地发挥作用有什么建议吗?
我会很高兴得到答案。感谢大家,丹
我是人工智能和Python的新手,我正在尝试构建一个架构来训练一组图像。然后以过度拟合为目标。但到目前为止,我无法理解如何正确获取输入和输出。每当我尝试训练网络时,我总是看到错误:
mat1 and mat2 shapes cannot be multiplied (48x13456 and 16x64)
我的网络:
net2 = nn.Sequential(
nn.Conv2d(3,8, kernel_size=5, padding=0),
nn.ReLU(),
nn.MaxPool2d(kernel_size=2, stride=2),
nn.Conv2d(8,16, kernel_size=5, padding=0),
nn.ReLU(),
nn.MaxPool2d(kernel_size=2, stride=2),
nn.Flatten(),
nn.Linear(16,64),
nn.ReLU(),
nn.Linear(64,10)
)
Run Code Online (Sandbox Code Playgroud)
这是我正在执行的任务的一部分,我真的不明白为什么它没有运行。任何提示!
Alexnet图像输入的转换如下:
transforms.Resize(256),
transforms.CenterCrop(224),
Run Code Online (Sandbox Code Playgroud)
为什么我们首先将图像大小调整为 256,然后将其居中裁剪为 224?我知道 ImageNet 的默认图像大小是 224x224,但是为什么我们不能直接将图像大小调整为 224x224?
当我尝试使用 pytorch 训练 CNN 模型时出现错误这是我创建的模型
该模型
import torch
class NNnet(torch.nn.Module):
def __init__(self, channels = 19, samples = 1000.0, outputs = 4):
super(NNnet, self).__init__()
#Sequential 1
self.seq1 = torch.nn.Sequential(
torch.nn.Conv2d(in_channels = 1, out_channels = 32, kernel_size = (1,20), stride = 1),
torch.nn.Conv2d(in_channels = 32, out_channels = 32, kernel_size = (3,1), stride = 1),
torch.nn.BatchNorm2d(32, eps = 0.001, momentum = 0.99),
torch.nn.ReLU(),
torch.nn.MaxPool2d(kernel_size = [1,5], stride = [1,2])
)
#calculate output of sample at each opeartion
samples = (samples - 20) + …Run Code Online (Sandbox Code Playgroud) 深度学习最近是一场革命,它的成功与我们目前可以管理的大量数据和GPU的概括有关.
所以这就是我面临的问题.我知道深层神经网络具有最佳性能,毫无疑问.但是,当训练样本的数量巨大时,它们具有良好的性能.如果训练样本的数量较少,则最好使用SVM或决策树.
但是什么是巨大的?什么是低?在本文的人脸识别(FaceNet by Google)中,他们展示了性能与失败的关系(可以与训练样例的数量相关)
他们使用了100M到200M的训练样例,这是非常大的.
我的问题是:有没有任何方法可以提前预测我需要在深度学习中取得良好表现的训练样例数量?我之所以这样说是因为如果性能不好,手动分类数据集是浪费时间的.
machine-learning training-data neural-network deep-learning conv-neural-network
我在图像着色论文中读到的端到端时尚卷积神经网络(CNN)是什么意思?
machine-learning computer-vision neural-network deep-learning conv-neural-network
我正在尝试运行此代码,但收到以下错误:
Using TensorFlow backend.
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "BestSplits" device_type: "CPU"') for unknown op: BestSplits
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "CountExtremelyRandomStats" device_type: "CPU"') for unknown op: CountExtremelyRandomStats
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "FinishedNodes" device_type: "CPU"') for unknown op: FinishedNodes
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "GrowTree" device_type: "CPU"') for unknown op: GrowTree
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "ReinterpretStringToFloat" device_type: "CPU"') for unknown op: ReinterpretStringToFloat
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "SampleInputs" device_type: "CPU"') for unknown op: SampleInputs
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "ScatterAddNdim" device_type: "CPU"') for …Run Code Online (Sandbox Code Playgroud) 我正在尝试加载与之一起保存的模型: model.save('myModel.h5')
该模型的定义如下:
self.model = VGGFace(input_tensor=input_tensor, include_top=True)
for layer in self.model.layers:
layer.trainable = False
self.model.get_layer('fc7').trainable = True
last_layer = self.model.get_layer('fc7').output
out = BatchNormalization()(last_layer)
out = Dense(self.n_outputs, activation='softmax', name='fc8')(out)
self.model = Model(input=self.model.input, output=out)
Run Code Online (Sandbox Code Playgroud)
当我尝试加载myModel.h5时model.load_model('myModel.h5')会引发以下错误:
AttributeError: 'Model' object has no attribute 'load_model'
Run Code Online (Sandbox Code Playgroud)
我认为这是因为我不使用Sequential模型。
那我该如何加载我的模型?由于model.save('myModel.h5')似乎工作。
谢谢!!!!
我目前正在使用U-Net的修改版本(https://arxiv.org/pdf/1505.04597.pdf)分割显微镜图像中的细胞器。由于我使用的是Keras,因此我从https://github.com/zhixuhao/unet获取了代码。但是,在此版本中,未实现任何权重图来强制网络学习边界像素。
到目前为止,我获得的结果相当不错,但是网络无法分离彼此靠近的对象。因此,我想尝试利用本文中提到的权重图。我已经能够为每个标签图像生成权重图(基于给定的公式),但是我无法找到如何使用该权重图来训练我的网络并因此解决上述问题的方法。
权重图和标签图像是否必须以某种方式组合,还是有Keras函数可以让我利用权重图?我是生物学家,最近才开始使用神经网络,所以我的理解仍然很有限。任何帮助或建议,将不胜感激。
码
import numpy as np
from keras.preprocessing.image import ImageDataGenerator
from keras.models import Sequential,Model
from keras.layers import Dropout, Flatten, Dense,Input
from keras import applications
from keras.preprocessing import image
from keras import backend as K
K.set_image_dim_ordering('tf')
# dimensions of our images.
img_width, img_height = 150,150
top_model_weights_path = 'bottleneck_fc_model.h5'
train_data_dir = 'Cats and Dogs Dataset/train'
validation_data_dir = 'Cats and Dogs Dataset/validation'
nb_train_samples = 20000
nb_validation_samples = 5000
epochs = 50
batch_size = 16
input_tensor = Input(shape=(150,150,3))
base_model=applications.VGG16(include_top=False, weights='imagenet',input_tensor=input_tensor)
for layer in base_model.layers:
layer.trainable …Run Code Online (Sandbox Code Playgroud) python machine-learning conv-neural-network keras pre-trained-model