Visual Question Answering in Tensorflow实战

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/weixin_38569817/article/details/82659122

主要参考:https://github.com/paarthneekhara/neural-vqa-tensorflow
论文地址:https://arxiv.org/abs/1505.02074

项目百度网盘地址:https://pan.baidu.com/s/1d47Hxu5Xl71UYniKWPDfpQ
开始爬坑:
首先服务器是linux,但是不能连接网络。因此只能在windows下进行。
按照步骤,首先就是获取数据。

坑1:Download the MSCOCO train+val images and VQA data using Data/download_data.sh. Extract all the downloaded zip files inside the Data folder.
可以看到,download_data.sh为空。解决办法: 另一个Torch implementation of neural-VQA版本中有download_data.sh。打开复制链接,进行下载。

坑2:
Extract the fc-7 image features using:
python extract_fc7.py –split=train
python extract_fc7.py –split=val
因为我在windows下的python版本是3。需要修改源代码。

坑3:
data_loader.py:
if name == “main“:
prepare_training_data()
增加上面代码,执行数据预处理程序。
extract_fc7.py:
all_data = data_loader.load_questions_answers(args)
->all_data = data_loader.load_questions_answers()
predict.py:
vocab_data = data_loader.get_question_answer_vocab(args.data_dir)
->vocab_data = data_loader.get_question_answer_vocab()
predict.py:parser.add_argument(‘–model_path’, type=str, default = ‘Data/Models/model133.ckpt’,目录要写死,不然读取模型文件失败。
evaluate.py:parser.add_argument(‘–model_path’, type=str, default = ‘Data/Models/model133.ckpt’目录要写死,不然读取模型文件失败。

python predict.py –image_path=”Data/test/8.jpg” –question=”What are they doing?”

猜你喜欢

转载自blog.csdn.net/weixin_38569817/article/details/82659122