simon-ging / coot-videotext

COOT: Cooperative Hierarchical Transformer for Video-Text Representation Learning
Apache License 2.0
288 stars 55 forks source link

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

Open liujiaqiKiKi opened 3 years ago

liujiaqiKiKi commented 3 years ago

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.

simon-ging commented 3 years ago

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.

liujiaqiKiKi commented 3 years ago

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

liujiaqiKiKi commented 3 years ago

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

simon-ging commented 3 years ago

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.

liujiaqiKiKi commented 3 years ago

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()

simon-ging commented 3 years ago

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.

liujiaqiKiKi commented 3 years ago

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'.

simon-ging commented 3 years ago

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.

liujiaqiKiKi commented 3 years ago

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.