markdtw / vqa-winner-cvprw-2017 Goto Github PK
View Code? Open in Web Editor NEWPytorch implementation of winner from VQA Chllange Workshop in CVPR'17
Pytorch implementation of winner from VQA Chllange Workshop in CVPR'17
Hello we are using you code to preprocess the data and build a few models on top of and are running into some bugs. Don't know why this is not working for us.
https://github.com/SinghJasdeep/CS230-CS224N-VQA
Mainly issues in the loader.py file:
i_batch.append(self.i_feat[iid]) is actually a dictionary not an array of size (36,2048)?
Your help would be greatly appreciated Mark.
Hi, I try to add this dataset to train, and follow this paper's guide, use ' questions whose correct answers overlap the output vocabulary determined on the VQA v2 dataset'. But I got 970,000 questions or so, and it is much larger than 485,000 questions reported in the paper. Have any ideas?
Does this implementation get the performance reported by the paper?
Hi, How to visualize the attention
you mean the accuracy is 64.42% when training or validating? Why 'sigmoid multi-label classifier is also implemented but I can't train based on that'?
Thank you in advance!
I download the code and try to reimplement your score on VQA 2.0 set. Since my computer cannot support the whole training data, I split the - vqa_train_final.json and - coco_features.npy into 7 folds, each set of them grouped by imageid.(like vqa_train_final.0.json contains image ids : [1, 2, 3] the coco_features.0.npy contains image features of [1, 2, 3] and other sets doesnot have any data related to image [1, 2, 3]) I train the model in two way, one is loading the data from 0 to 6 in each epoch and repeat 50 times. the other is loading each data set training 50 epochs and then move on to the next data set.
However, both of them result in a low accuracy, 30% or so. the tokenized question, coco 36 features is downloaded from the link you described. what do you think might be the cause? Thanks
this is how I split the data
def split_images():
list_train = os.listdir('G:/train2014/')
list_train.remove('COCO_train2014_000000372405.jpg')
ids = [int(f[15:27]) for f in list_train]
length = int(len(ids)/7)+1
ids_list = [ids[i:i + length] for i in range(0, len(ids), length)]
for i in range(len(ids_list)):
np.savetxt("split/imageIds.train." + str(i), ids_list[i], fmt='%d')
def split_json():
train = json.load(open('vqa_train_final.json'))
for i in range(7):
ids = np.loadtxt("split/imageIds.train." + str(i)).astype(int)
s = set(ids)
data = []
for j in range(len(train)):
if train[j]['image_id'] in s:
data.append(train[j])
json.dump(data, open('split/vqa_train_final.json.' + str(i), 'w'))
for k in range(7):
ids = np.loadtxt("split/imageIds.train." + str(k)).astype(int)
s = set(ids)
in_data = {}
with open(infile, "rt") as tsv_in_file:
reader = csv.DictReader(tsv_in_file, delimiter='\t', fieldnames = FIELDNAMES)
i = 0
for item in reader:
i = i+1
if i % 1000 == 0:
print(k,i)
try:
data = {}
data['image_id'] = int(item['image_id'])
if data['image_id'] in s:
b = base64.decodestring(bytes(item['features'], encoding = "utf8"))
data['features'] = np.frombuffer(b, dtype=np.float32).reshape((36, -1))
in_data[data['image_id']] = data['features']
except:
print('error',item['image_id'])
np.save('split/coco_features.npy.train.' + str(k), in_data)
Hello, thank you very much for your code, but I raised the following questions during the training, may I ask why?
Traceback (most recent call last):
File "main.py", line 153, in
main()
File "main.py", line 119, in main
train_loader, val_loader, vocab_size, num_classes = prepare_data(args)
File "/home/disk/lmc/vqa-winner-cvprw-2017/data_loader.py", line 72, in prepare_data
VQAv2(root=args.data_root, train=True),
File "/home/disk/lmc/vqa-winner-cvprw-2017/data_loader.py", line 38, in init
que[i] = word2idx[word]
IndexError: index 14 is out of bounds for axis 0 with size 14
vqa-winner-cvprw-2017/data_loader.py
Line 36 in 88894c8
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.