CVPR 2020 运行SGMN遇到的问题及解决办法
生活随笔
收集整理的這篇文章主要介紹了
CVPR 2020 运行SGMN遇到的问题及解决办法
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
目錄
- 文章簡介
- Issues
- 環(huán)境配置
- Ref-Reasoning數(shù)據(jù)集格式
- train(val)_expression.json
- train(val)_sgs.json
- train(val)_sg_seqs.json
- gt_objects_info.json
- *_sgs.json
- *_sg_seqs.json
文章簡介
Graph-Structured Referring Expressions Reasoning in The Wild
代碼鏈接
論文鏈接
Issues
在作者代碼的README中,有環(huán)境配置的步驟,不過python2.7+pytorch0.4.0支持的cuda版本和本機(jī)顯卡支持的cuda版本存在沖突,無法正常運(yùn)行代碼,會(huì)出現(xiàn)以下錯(cuò)誤:
# 錯(cuò)誤1 RuntimeError: cuDNN version mismatch: PyTorch was compiled against 7102 but linked against 7605 # 錯(cuò)誤2 CUDNN_STATUS_EXECUTION_FAILED錯(cuò)誤1可以通過以下命令解決:
conda install cudnn=7.1.2錯(cuò)誤2是版本沖突,我沒解決,所以沒辦法和作者用一樣的環(huán)境。但是,在python3的環(huán)境下,作者的代碼稍作調(diào)整也可以運(yùn)行,具體配置步驟見下文。
環(huán)境配置
本機(jī)環(huán)境:
- ubuntu18.04
- rtx 2080ti
- NVIDIA-SMI 450.57
基于本機(jī)環(huán)境,我配置的conda虛擬環(huán)境中,各軟件版本如下:
- 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
在上述環(huán)境中,對(duì)代碼稍微修改一下(主要是python2→\rightarrow→ python3,如print xxx,改為print(xxx)),即可正常運(yùn)行。
環(huán)境配置代碼:
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運(yùn)行程序代碼:
git clone https://github.com/sibeiyang/sgmn.git && cd sgmn # 建立軟鏈接一定要用絕對(duì)路徑 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 $GPUsRef-Reasoning數(shù)據(jù)集格式
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},... }總結(jié)
以上是生活随笔為你收集整理的CVPR 2020 运行SGMN遇到的问题及解决办法的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 20201010《近代数学》第1节课 笔
- 下一篇: VS Code无法远程连接服务器的解决办