deep-learning

Failure to install old versions of transformers in colab

Failure to install old versions of transformers in colab Question: I recently had a problem installing Transformer version 2.9.0 in colab. Asked By: hana || Source Answers: Colab has recently upgraded to Python 3.9. There is a temporary mechanism for users to run Python 3.8 runtime (Linux-5.10.147+-x86_64-with-glibc2.29 platform). This is available from the Command Palette …

Total answers: 2

predicting data bug with keras

predicting data bug with keras Question: Hi im trying to build a model in keras that can predict some data based on training values. I’ve seen this work succesfully all over the internet but my example code doesn’t work: from keras.models import Sequential from keras.layers import Dense, Activation import numpy as np model = Sequential() …

Total answers: 1

How to replace specific string in data frame column value?

How to replace specific string in data frame column value? Question: I have input.txt file that has 2 columns (file_name,text) and want to replace " " seprater charchter (which represnt tab here becuse I spreated txt file by this char) that apperar in text column example for input file : 0.jpg Jól olvasom? Összesen négy, …

Total answers: 2

How do you load a specific GPU from CUDA_AVAILABLE_DEVICES in PyTorch?

How do you load a specific GPU from CUDA_AVAILABLE_DEVICES in PyTorch? Question: I came up with this code but it’s resulting in never ending bugs: def get_device_via_env_variables(deterministic: bool = False, verbose: bool = True) -> torch.device: device: torch.device = torch.device("cpu") if torch.cuda.is_available(): if ‘CUDA_VISIBLE_DEVICES’ not in os.environ: device: torch.device = torch.device("cuda:0") else: gpu_idx: list[str] = …

Total answers: 2

Huggingface Trainer throws an AttributeError:'Namespace' object has no attribute 'get_process_log_level

Huggingface Trainer throws an AttributeError:'Namespace' object has no attribute 'get_process_log_level Question: I am trying to run Trainer from Hugging face(pytorch) with arguments parser. My code looks like if __name__ == ‘__main__’: parser = HfArgumentParser(TrainingArguments) parser.add_argument(‘–model_name_or_path’, type=str, required=True) . . . . training_args = parser.parse_args() print(‘args’, training_args) os.makedirs(training_args.output_dir, exist_ok=True) random.seed(training_args.seed) set_seed(training_args.seed) dataset_train = … . . …

Total answers: 1

How to record each fold`s validation loss during cross-validation in Optuna?

How to record each fold`s validation loss during cross-validation in Optuna? Question: I am using Toshihiko Yanase`s code for doing cross validation on my hyperparameter optimizer with Optuna. Here is the code that I am using: def objective(trial, train_loader, valid_loader): # Remove the following line. # train_loader, valid_loader = get_mnist() … return accuracy def objective_cv(trial): …

Total answers: 1

Tensorflow: The channel dimension of the inputs should be defined

Tensorflow: The channel dimension of the inputs should be defined Question: I am new to Tensorflow, and am trying to train a specific deep learning neural network. I am using Tensorflow (2.11.0) to get a deep neural network model which is described below. The data which I use is also given below: Data: Here is …

Total answers: 1

FileNotFoundError: [Errno 2] No such file or directory for Image Dataset one-hot encoded

FileNotFoundError: [Errno 2] No such file or directory for Image Dataset one-hot encoded Question: I tried to one-hot encoded using to_categorical() in my image dataset but I failed because of FileNotFoundError: [Errno 2] No such file or directory error and the code is given below, import os import numpy as np from PIL import Image …

Total answers: 1