WuJie1010 / Temporally-language-grounding

A Pytorch implemention for some state-of-the-art models for" Temporally Language Grounding in Untrimmed Videos"
96 stars 21 forks source link

pickle.load problem #2

Closed yufansong closed 5 years ago

yufansong commented 5 years ago

I try to run your code, but I failed because of the pickle.load.

self.clip_sentence_pairs_iou_all = pickle.load(open("./Dataset/Charades/ref_info/charades_rl_train_feature.pkl"))

the the error is

TypeError: a bytes-like object is required, not 'str'

then I try

pickle.load(open("./Dataset/Charades/ref_info/charades_rl_train_feature.pkl",'rb'))

but the error is

UnicodeDecodeError: 'ascii' codec can't decode byte 0x81 in position 0: ordinal not in range(128)

I also tried several methods, but none of them working. Such as add encoding/decoding, import sys ...... I also try to use python2.7 load the data, but I get the same errors.

yufansong commented 5 years ago

I solve this problem by using the code below

with open("./Dataset/Charades/ref_info/charades_rl_train_feature.pkl",'rb') as f:
    content = pickle.load(f,encoding='latin1')

This is the corresponding document