deep-learning

Can't Initialise Two Different Tokenizers with Keras

Can't Initialise Two Different Tokenizers with Keras Question: For spelling correction task, I build a seq2seq model including LSTM and attention mechanism. I do char-level tokenisation with Keras. I initialised two different tokenizers, one for typo sentence and the other for corrected sentence. After testing, I see that model produced empty string and I believe …

Total answers: 1

Torch in python unable to get some layers like add from model structure

Torch in python unable to get some layers like add from model structure Question: I have this simple code to write down structure of network. model = torch.jit.load(‘best5.torchscript’) file_object = open(‘sample.txt’, ‘a’) for name, module in model.named_modules(): file_object.write(str(module)) Problem is that some layers like "add" is not present for example this is part from output …

Total answers: 1

Get all layers including operators from torch in python

Get all layers including operators from torch in python Question: I want to get all layers like convolution etc… and operator like "add" in python but I really dont know how. This is my code import torch # An instance of your model. model = torch.jit.load(‘best5.torchscript’) # Print all the layers for name, param in …

Total answers: 1

How do I print the wandb sweep url in python?

How do I print the wandb sweep url in python? Question: For runs I do: wandb.run.get_url() how do I do the same but for sweeps given the sweep_id? fulls sample run: """ Main Idea: – create sweep with a sweep config & get sweep_id for the agents (note, this creates a sweep in wandb’s website) …

Total answers: 1

How to rename images name using data frame?

How to rename images name using data frame? Question: I have a data frame that has file_name and corresponding text and want to update the file_name and the image name in imgs folder by concatenating with some text or number the structure of input_folder look like : input_folder –| |— imgs — |– 0.jpg |– …

Total answers: 1

pytorch I don't know how to define multiple models

pytorch I don't know how to define multiple models Question: I want to use two different models in pytorch. Therefore, I executed the following code, but I cannot successfully run the second model. How can I do this? class Model(nn.Module): def __init__(self): super(Model, self).__init__() self.linear1 = nn.Linear(2, 64) self.linear2 = nn.Linear(64, 3) def forward(self, x): …

Total answers: 1

Loss is Nan for SegFormer vision transformer trained on BDD10k

Loss is Nan for SegFormer vision transformer trained on BDD10k Question: I’m trying to implement a SegFormer pretrained with a mit-b0 model to perform semantic segmentation on images obtained from the bdd100k dataset. Specifically, semantic segmentation has masks for only a subset of the 100k images, being 10k with appropriate masks for segmentation where the …

Total answers: 4

Shapes for training data and labels

Shapes for training data and labels Question: I am trying to train a convolutional neural network using Conv1D and sparse_categorical_crossentropy as a loss function but I keep having problems related to the shapes of the data. Here is the network: model=models.Sequential() model=tf.keras.models.Sequential([ tf.keras.layers.Conv1D(16, 24, input_shape=(1000, 4), activation="relu"), tf.keras.layers.MaxPooling1D(pool_size=24, strides=24), tf.keras.layers.Conv1D(8, 8, activation="relu"), tf.keras.layers.MaxPooling1D(pool_size=8, strides=8), tf.keras.layers.Flatten(), …

Total answers: 1

How to merge many data frames to only one

How to merge many data frames to only one Question: I have directory that has many folders inside each folder has (images folder & labels text) and I want to combine them to one dataframe file by concatnating folders name with images name to make them uinque names . The structuer of my directory like …

Total answers: 1

Deep Learning training slower on Google Cloud VM than Local PC

Deep Learning training slower on Google Cloud VM than Local PC Question: I am trying to train an LSTM neural network using Pytorch. On my own computer the process is quite slow due to the complexity of the model and size of the dataset. My initial thought was to move the training to a cloud …

Total answers: 1