text icon indicating copy to clipboard operation
text copied to clipboard

Where am i wrong?

Open LiangTiger opened this issue 6 years ago • 0 comments

❓ Questions and Help

Description

import numpy as np import random import pandas as pd

USE_CUDA=torch.cuda.is_available() BATCH_SIZE=32 EMBEDDING_SIZE=100 MAX_VOCAB_SIZE=50000 device=torch.device('cuda')

TEXT=torchtext.data.Field(lower=True) LABEL=torchtext.data.LabelField(dtype=torch.long) train=torchtext.data.TabularDataset(path='train.csv',format='csv',skip_header=True,fields=[('id',None),('keyword',None),('location',None),('text',TEXT),('target',LABEL)]) TEXT.build_vocab(train,max_size=MAX_VOCAB_SIZE) VOCAB_SIZE=len(TEXT.vocab) train_iter=torchtext.data.BPTTIterator(dataset=train,batch_size=BATCH_SIZE,device=device,bptt_len=32,repeat=False,shuffle=True) next(iter(train_iter)) errors: Traceback (most recent call last): Python Shell, prompt 2, line 1 builtins.StopIteration:

LiangTiger avatar Feb 14 '20 03:02 LiangTiger