Scene-Graph-Benchmark.pytorch(KaihuaTang)代码配置过程记录

Scene-Graph-Benchmark.pytorch(KaihuaTang)代码配置过程记录,第1张

Scene-Graph-Benchmark.pytorch(KaihuaTang)代码配置过程记录
  1. GitHub地址:https://github.com/KaihuaTang/Scene-Graph-Benchmark.pytorch

  2. 我的配置:

  3. 原服务器中已经装了:cuda10.1和cuda9.0,但是想要配置cuda11.0。

  4. 配置过程

  • 第一步是在服务器上安装cuda11.0.参照:
    https://zhuanlan.zhihu.com/p/122286055
  • 第二步:根据https://github.com/KaihuaTang/Scene-Graph-Benchmark.pytorch/blob/master/INSTALL.md,其中在
    conda install pytorch1.4.0 torchvision0.5.0 cudatoolkit=10.1 -c pytorch 更改为
    conda install pytorch1.7.1 torchvision0.8.2 torchaudio==0.7.2 cudatoolkit=11.0 -c pytorch
    (其他版本可以根据https://pytorch.org/get-started/previous-versions/进行选择)
  • 其它步骤与https://github.com/KaihuaTang/Scene-Graph-Benchmark.pytorch/blob/master/INSTALL.md相同。
  1. 可能遇到的问题:
  • cannot create temp file for here-document: No space left on device
    https://blog.csdn.net/weixin_37029453/article/details/107664402

  • torch1.4版本的话,在后续的训练过程中,会出现 torch.cuda.amp not found的问题,因为amp在torch1.6之后才有集成

  • python setup.py build_ext install出现问题:
    gcc -pthread -B /home/chentongbao/.conda/envs/scene_graph_benchmark/compiler_compat -Wl,–sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/chentongbao/.conda/envs/scene_graph_benchmark/lib/python3.8/site-packages/numpy/core/include -I…/common -I/home/chentongbao/.conda/envs/scene_graph_benchmark/include/python3.8 -c pycocotools/_mask.c -o build/temp.linux-x86_64-3.8/pycocotools/_mask.o -Wno-cpp -Wno-unused-function -std=c99
    gcc: error: pycocotools/_mask.c: No such file or directory
    error: command ‘gcc’ failed with exit status 1
    – 解决办法:
    conda install cython
    来自 https://github.com/facebookresearch/maskrcnn-benchmark/issues/1225

  • 问题:python setup.py install --cuda_ext --cpp_ext时出现了问题,
    来自 https://github.com/tongbaochen/Scene-Graph-Benchmark.pytorch/blob/master/INSTALL.md
    https://github.com/facebookresearch/maskrcnn-benchmark/issues/1275
    – 解决办法,最终,直接使用:python setup.py install
    来自 https://github.com/NVIDIA/apex/pull/323#discussion_r287021798

  • gcc、g++的版本对应问题,建立软连接问题

  • 环境变量设置问题:vim ~/.bashrc,在文件的末尾采用export进行变量的定义,然后保存退出,采用source ~/.bashrc对文件进行实时更新

  • 定义临时变量

  • pytroch小坑,需设置CUDA_HOME环境变量,保证全局CUDA环境变量一致。在bashrc上进行设置

  • vim中进行文件查找:输入斜杠/,然后输入 目标,接着回车,然后点击n为下一个,N为上一个。wq保存并退出,q!不保存,强制退出

  • 其他可能的问题,借鉴:https://blog.csdn.net/m0_37867091/article/details/121429992

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5679797.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存