CVPR 2020 运行SGMN遇到的问题及解决办法

文章简介

Graph-Structured Referring Expressions Reasoning in The Wild
代码链接
论文链接

Issues

在作者代码的README中,有环境配置的步骤,不过python2.7+pytorch0.4.0支持的cuda版本和本机显卡支持的cuda版本存在冲突,无法正常运行代码,会出现以下错误:

# 错误1
RuntimeError: cuDNN version mismatch: PyTorch was compiled against 7102 but linked against 7605
# 错误2
CUDNN_STATUS_EXECUTION_FAILED

错误1可以通过以下命令解决:

conda install cudnn=7.1.2

错误2是版本冲突,我没解决,所以没办法和作者用一样的环境。但是,在python3的环境下,作者的代码稍作调整也可以运行,具体配置步骤见下文。

环境配置

本机环境:

  • ubuntu18.04
  • rtx 2080ti
  • NVIDIA-SMI 450.57

基于本机环境,我配置的conda虚拟环境中,各软件版本如下:

  • python 3.6.2
  • pytorch 1.4.0 - py3.6_cuda10.0.130_cudnn7.6.3_0
  • torchvision 0.5.0 - py36_cu100
  • scipy 1.5.2
  • numpy 1.19.1
  • h5py 2.10.0
  • cudatoolkit 10.0.130

在上述环境中,对代码稍微修改一下(主要是python2 → \rightarrow python3,如print xxx,改为print(xxx)),即可正常运行。

环境配置代码:

conda create -n lchpy36 python=3.6
source activate lchpy36
conda install pytorch torchvision cudatoolkit=10.0 -c pytorch
pip install h5py
pip install scipy

运行程序代码:

git clone https://github.com/sibeiyang/sgmn.git && cd sgmn
# 建立软链接一定要用绝对路径
ln -s /home/mcislab/dist4T/chuanhao/dataset/Ref-Reasoning/refvg/ /home/mcislab/dist4T/chuanhao/code/sgmn/data/
ln -s /home/mcislab/dist4T/chuanhao/dataset/Ref-Reasoning/gt_objects/ /home/mcislab/dist4T/chuanhao/code/sgmn/data/
ln -s /home/mcislab/dist4T/chuanhao/others/sgmn_glove/word_embedding/ /home/mcislab/dist4T/chuanhao/code/sgmn/data/
bash experiments/script/train.sh $GPUs

Ref-Reasoning数据集格式

train(val)_expression.json

{"825670": 
	{"num_nodes": 4, 
	 "referent_id": "4306103", 
	 "image_id": "2384229", 
	 "bbox": [215, 50, 43, 55], 
	 "expression": "There is a people to the right of man and to the left of a wine , and the man holding empty glass ."}, 
	
	...
}

train(val)_sgs.json

{"800000": 
	{"words_info": [[1, "det", 0, "a"], 
					[1, "amod", 0, "yellow"], 
					[1, "head", 0, "frisbee"], 
					[1, "none", 1, "to"], 
					[1, "none", 1, "the"], 
					[1, "none", 1, "left"], 
					[1, "none", 1, "of"], 
					[1, "head", 2, "man"], 
					[0, "none", 3, "that"], 
					[0, "none", 3, "is"], 
					[1, "none", 3, "wearing"], 
					[1, "amod", 4, "white"], 
					[1, "head", 4, "socks"], 
					[1, "none", 5, "and"], 
					[0, "none", 5, "is"], 
					[1, "none", 5, "wearing"], 
					[1, "head", 6, "shorts"], 
					[1, "none", 7, "."]], 
	 "co_index": {}},

	...
}

train(val)_sg_seqs.json

{"800000":
	 {"seq_sg": [{"seq_rel": [], "type": "S", "seq": [7]}, 
	 			 {"seq_rel": [], "type": "SPO", "seq": [2, 5, 6]}, 
	 			 {"seq_rel": [[2, 1, "SUBANDSUB"]], "type": "SPO", "seq": [2, 3, 4]},
	 			 {"seq_rel": [[3, 2, "OBJANDSUB"]], "type": "SPO", "seq": [0, 1, 2]}], 
	 "com_seq": [0, 3], 
	 "num_seq": 4, 
	 "split_to_seq": {"0": 3, "2": 3, "4": 2, "7": 0, "6": 1}},
	
	...
}

gt_objects_info.json

{"2379671":
	{"width": 500, 
	 "idx": 1541, 
	 "file": 2, 
	 "objectsNum": 15, 
	 "height": 438},
	
	 ...
}

*_sgs.json

basic info about language scene graph

{"expression_id":
	{"word_info": list of info (split id, dependent type, weight, word)
	 "co_index": dictionary from one split id to its coreference's split id
	},

	...
}

*_sg_seqs.json

structured info about language scene graph

{"expression_id":
	{"seq_sg": list of nodes and edges. Each node and edge includes its phrase listed by split ids, its relations to other nodes and edges, and its type info.
	 "com_seq": list of indexes of elements with zero out-degree in seq_sg
	 "num_seq": number of nodes and edges
	 "split_to_seq": dictionary from one split id to the index of seq_sg
	},

	...
}
  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
2020年的计算机视觉与模式识别国际会议(CVPR)中,小样本学习成为了一个热门话题。在CVPR 2020中,许多重要的研究都集中于小样本学习解决方案。 小样本学习的意义在于模型如何从很少的数据点中学习。在现实世界中,我们面临的很多问题都是小样本问题,例如医学影像分析,金融风险评估,自然语言处理等等。采用小样本学习的方法为这些问题提供了有效的解决方案。 在2020年的CVPR中,研究者们提出了许多小样本学习算法和模型。其中最重要的是元学习。元学习在小样本学习中非常重要。元学习的基本思想是通过迁移学习,让模型从不同数据集中进行学习并进行知识迁移学习。在元学习中,一个模型会从一个任务中学习并推广到其他任务中。 另一种常见的小样本学习方法是采用生成式对抗网络(GANs)进行特征提取和图像生成。研究者们使用GANs来生成新的图片样本,从而增加数据样本的数量。这种方法在小样本学习中非常有用,因为GANs可以生成无限数量的样本集。 总之,小样本学习在计算机视觉和模式识别领域中变得越来越重要。在CVPR 2020中,我们看到了许多新方法和技术的出现,它们为解决小样本学习问题提供了前所未有的解决方案。我们相信,随着更多的研究和技术的进步,小样本学习将成为计算机视觉和模式识别的重要工具。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值