conv-neural-network

How to combine a masked loss with tensorflow2 TimeSeriesGenerator

How to combine a masked loss with tensorflow2 TimeSeriesGenerator Question: We are trying to use a convolutional LSTM to predict the values of an image given the past 7 timesteps. We have used the tensorflow2 TimeSeriesGenerator method to create our time series data: train_gen = TimeseriesGenerator( data, data, length=7, batch_size=32, shuffle=False ) Every image (timestep) …

Total answers: 1

Python train convolutional neural network on csv numpy error input shape

Python train convolutional neural network on csv numpy error input shape Question: I would like to train a convolutional neural network autoencoder on a csv file. The csv file contains pixel neighborhood position of an original image of 1024×1024. When I try to train it, I have the following error that I don’t manage to …

Total answers: 1

Which CNN model is useful to estimate deviations from dataset?

Which CNN model is useful to estimate deviations from dataset? Question: I have dataset folders. there is x and y values(as expected and result) and also there is the result of deviation. I would like to develop a CNN algorithm, which can learn how to calculate those deviations from dataset. When I put the excel …

Total answers: 1

Why torch.nn.Conv2d() divides the image into 9 parts?

Why torch.nn.Conv2d() divides the image into 9 parts? Question: Sorry for the stupid question but, why torch.nnnConv2d() divides the image into 9 parts? import torch from torch import nn import cv2 img = cv2.imread("image_game/eldenring 2022-12-14 19-29-50.png") cv2.imshow(‘input’, img) size = img.shape # (720, 1280, 3) img = img.reshape((1, img.shape[2], size[0], size[1])) img = torch.tensor(img, dtype=torch.float32) …

Total answers: 1

Can you explain how the feature is extracted from the following code of CNN

Can you explain how the feature is extracted from the following code of CNN Question: How the Image Features are extracted from the following convolutional neural network code import tensorflow as tf from tensorflow.keras.utils import img_to_array df[‘PubChem_ID’] = df[‘PubChem_ID’].apply(str) df_image = [] for i in tqdm(range(df.shape[0])): img = image.load_img(‘/content/drive/MyDrive/3D Conformer/Conformer/’+df[‘PubChem_ID’] [i]+’.png’,target_size=(256,256,3)) img = image.img_to_array(img) img …

Total answers: 1

Runtime Error: mat1 and mat2 shapes cannot be multiplied (16×756900 and 3048516×30)

Runtime Error: mat1 and mat2 shapes cannot be multiplied (16×756900 and 3048516×30) Question: How can I solve this problem? class Net(nn.Module): def __init__(self): super().__init__() self.conv1 = nn.Conv2d(3,8,11, padding=0) # in_channel, out_channel, kernel size self.pool = nn.MaxPool2d(2,2) # kernel_size, stride self.conv2 = nn.Conv2d(8, 36, 5, padding=0) self.fc1 = nn.Linear(36*291*291, 30) # in_features, out_features self.fc2 = nn.Linear(30, …

Total answers: 1

Graph disconnected: cannot obtain value for tensor Tensor("input_20:0", shape=(?, 25, 2), dtype=float32) at layer "input_20"

Graph disconnected: cannot obtain value for tensor Tensor("input_20:0", shape=(?, 25, 2), dtype=float32) at layer "input_20" Question: I try to combine two CNNs with Keras. Here is the code: import keras from keras import Model from keras.layers.core import Dense, Activation from keras.layers import Conv2D, Conv1D, MaxPooling2D, Reshape, Concatenate, Dropout , MaxPooling1D, Flatten from keras.layers import Dense, …

Total answers: 1

NaN from tf.get_collection(tf.GraphKeys.REGULARIZATION_LOSSES))

NaN from tf.get_collection(tf.GraphKeys.REGULARIZATION_LOSSES)) Question: I am doing a image segmentation using resnet50 as encoder and made the decoder with unpooling layers with skip layers in tensorflow Here is the model structure, For the loss function, I used the dice_coefficient and IOU formula, and calculated the total loss by adding both. In addition to the total …

Total answers: 1

How to turn a cifar10 dataset into a tensor

How to turn a cifar10 dataset into a tensor Question: I am trying to turn the cifar10 dataset into a tensor with trainset = datasets.CIFAR10(root=’./data’, train=True, download=True, transform=transforms.ToTensor()) but it continually returns false when I run it torch.is_tensor(trainset) function which means it’s not a tensor and it also doesn’t work for functions that require tensors …

Total answers: 1