coot-videotext icon indicating copy to clipboard operation
coot-videotext copied to clipboard

Run:python train_caption.py -c config/caption/paper2020/yc2_100m_coot_vidclip_mart.yaml[BUG]

Open liujiaqiKiKi opened this issue 4 years ago • 9 comments

Hello!I get some Keyerrors when I run the follow command. Command:python train_caption.py -c config/caption/paper2020/yc2_100m_coot_vidclip_mart.yaml

Error is as follows: error error2 error3

system:windows10 pytorch1.7.1+cuda11

Please help me!Thank you.

liujiaqiKiKi avatar May 11 '21 08:05 liujiaqiKiKi

Hey, the same command runs on my end. My guess would be that something went wrong during data setup. Follow the readme setup steps again, especially "Prepare pretrained models / embeddings" where you extract the embeddings. The keys will be loaded from provided_embeddings/yc2_100m_coot_train.h5 and ...val.h5.

simon-ging avatar May 11 '21 10:05 simon-ging

Thank you for your reply.I will try downloading the model again.

liujiaqiKiKi avatar May 11 '21 12:05 liujiaqiKiKi

Hi,I redownloaded the models/embeddings and put it in the project folder.But KeyError still appears when I run this command.Follow readme without error until this command. error

liujiaqiKiKi avatar May 12 '21 01:05 liujiaqiKiKi

Try this to see if the correct keys are loaded from the embeddings file:

import h5py file = h5py.File("provided_embeddings/yc2_100m_coot_train.h5", "r") vid_ids = [key.decode("utf8") for key in file["key"]] "CtAJhyW0j_M" in vid_ids

Last line should say True, otherwise your file is corrupt.

One thing to try would be to delete everything you have and start from scratch with the repository.

simon-ging avatar May 12 '21 08:05 simon-ging

Hi,Thank you for your quick response. I started the project from scratch again,but I still encountered different KeyErrors in this command. Is it because I didn't add the following code: import h5py h5 = h5py.File("provided_embeddings/anet_coot.h5", "r") h5.keys()

liujiaqiKiKi avatar May 16 '21 04:05 liujiaqiKiKi

The above code is only for checking what keys are in the file. You should debug the code and compare:

  1. Which key is failing (it's the one in the KeyError)
  2. Which keys are available (it's the ones in self.coot_vid_id_to_vid_number, print this array and check it's content).

Also make sure you have the correct python versions.

simon-ging avatar May 16 '21 11:05 simon-ging

Hi,I guess it's because I changed "vid_ids = [key.decode("utf8") for key in data_file["key"]]" in recursive_caption_dataset.py. I changed decode to encode. But if I don't change it,I'll get an AttributeError: 'str' object has no attribute 'decode'.

liujiaqiKiKi avatar May 16 '21 13:05 liujiaqiKiKi

You need strings, if they are bytes then decode is correct, if they are already str like in your case then do not encode them to bytes, just leave them as they are.

simon-ging avatar May 16 '21 15:05 simon-ging

Hi,I ran the project after the readme,but the results in Table 6 and Table 13 didn't appear.Would you please tell me what I should do?

------------------ 原始邮件 ------------------ 发件人: "gingsi/coot-videotext" @.>; 发送时间: 2021年5月16日(星期天) 晚上11:55 @.>; @.@.>; 主题: Re: [gingsi/coot-videotext] Run:python train_caption.py -c config/caption/paper2020/yc2_100m_coot_vidclip_mart.yaml[BUG] (#33)

You need strings, if they are bytes then decode is correct, if they are already str like in your case then do not encode them to bytes, just leave them as they are.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

liujiaqiKiKi avatar May 26 '21 15:05 liujiaqiKiKi