You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to follow ConvCap: Convolutional Image Captioning(README.md)
But it doesn't work
after I write the code python main.py model_dir
It sends a error message like thie
[DEBUG] #words in wordlist: 9222
[DEBUG] Loading train data ... 3.029390 secs
C:\Users\410\anaconda3\envs\Image_Captioning\lib\site-packages\torch\optim\lr_scheduler.py:82: UserWarning: Detected call of lr_scheduler.step() before optimizer.step(). In PyTorch 1.1.0 and later, you should call them in the opposite order: optimizer.step() before lr_scheduler.step(). Failure to do this will result in PyTorch skipping the first value of the learning rate schedule.See more details at https://pytorch.org/docs/stable/optim.html#how-to-adjust-learning-rate
"https://pytorch.org/docs/stable/optim.html#how-to-adjust-learning-rate", UserWarning)
0%| | 0/5664 [00:00<?, ?it/s]
Traceback (most recent call last):
File "main.py", line 89, in
main()
File "main.py", line 72, in main
train(args)
File "D:\2021\컴퓨터 비전\eval\이미지 캡셔닝\train.py", line 90, in train
tqdm(enumerate(train_data_loader), total=nbatches):
File "C:\Users\410\anaconda3\envs\Image_Captioning\lib\site-packages\tqdm\std.py", line 1180, in iter
for obj in iterable:
File "C:\Users\410\anaconda3\envs\Image_Captioning\lib\site-packages\torch\utils\data\dataloader.py", line 819, in next
return self._process_data(data)
File "C:\Users\410\anaconda3\envs\Image_Captioning\lib\site-packages\torch\utils\data\dataloader.py", line 846, in _process_data
data.reraise()
File "C:\Users\410\anaconda3\envs\Image_Captioning\lib\site-packages\torch_utils.py", line 369, in reraise
raise self.exc_type(msg)
ValueError: Caught ValueError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "C:\Users\410\anaconda3\envs\Image_Captioning\lib\site-packages\torch\utils\data_utils\worker.py", line 178, in _worker_loop
data = fetcher.fetch(index)
File "C:\Users\410\anaconda3\envs\Image_Captioning\lib\site-packages\torch\utils\data_utils\fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "C:\Users\410\anaconda3\envs\Image_Captioning\lib\site-packages\torch\utils\data_utils\fetch.py", line 44, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "D:\2021\컴퓨터 비전\eval\이미지 캡셔닝\coco_loader.py", line 102, in getitem
wordclass[i, word_i] = self.wordlist.index(word)
ValueError: 'UNK' is not in list
How can I solve this?
The text was updated successfully, but these errors were encountered:
Eom-taeseon
changed the title
Can't train this model
Can't train this model (ValueError: 'UNK' is not in list)
Nov 8, 2021
I am having the exact same error.
To solve this error I simply added 'UNK' token to the wordlist.
In the program coco_loader.py , line number 40.
Replace the line
self.wordlist = ['EOS'] + sorted(wordlist)
with
self.wordlist = ['EOS'] + sorted(wordlist)+['UNK']
I'm trying to follow ConvCap: Convolutional Image Captioning(README.md)
But it doesn't work
after I write the code
python main.py model_dir
It sends a error message like thie
How can I solve this?
The text was updated successfully, but these errors were encountered: