pytorch-transformers-classification icon indicating copy to clipboard operation
pytorch-transformers-classification copied to clipboard

AttributeError: module 'torch.nn.functional' has no attribute 'one_hot'

Open nalcvp opened this issue 5 years ago • 1 comments

if args['do_train']: train_dataset = load_and_cache_examples(task, tokenizer) global_step, tr_loss = train(train_dataset, model, tokenizer) logger.info(" global_step = %s, average loss = %s", global_step, tr_loss)

I still get this error when running this step despite having torch 1.3.0 and torchvision 0.4.1. Has anyone found a solution for this error?

nalcvp avatar Nov 07 '19 15:11 nalcvp

This may be caused by an update to the Hugging Face Transformers library. Please consider using Simple Transformers as this repo may not be compatible with the current Hugging Face library.

ThilinaRajapakse avatar Nov 07 '19 15:11 ThilinaRajapakse