KaihuaTang / Scene-Graph-Benchmark.pytorch

A new codebase for popular Scene Graph Generation methods (2020). Visualization & Scene Graph Extraction on custom images/datasets are provided. It's also a PyTorch implementation of paper “Unbiased Scene Graph Generation from Biased Training CVPR 2020”
MIT License
1.03k stars 228 forks source link

Tips for Ampere GPU users (RTX 3090, 3080/ti, etc.) to run scene graph benchmark with CUDA 11 #148

Open entalent opened 2 years ago

entalent commented 2 years ago

Since Ampere GPUs only supports PyTorch built with CUDA 11 and later, we can only build this repository with CUDA 11.1 and PyTorch 1.8.1 or later. Here are the differences between the authors' installation instructions and my attempt on a machine with CUDA 11.1 and RTX 3090:

1) When building APEX, one may encounter "fatal error: ATen/cuda/CUDAGraphsUtils.cuh: No such file or directory", and this could be solved by executing git reset --hard 3fe10b5597ba14a748ebb271a6ab97c09c5701ac in the apex directory, as mentioned in the issue https://github.com/NVIDIA/apex/issues/1043 . 2) Then we should set the environment variable to let the apex build with the compute compatibility of Ampere GPU (compute compatibility 8.6) by executing export TORCH_CUDA_ARCH_LIST="8.6". However, if you use torch 1.7.0 built with cuda 11.0, apex can't be built since the nvcc of cuda 11.0 does not support compute compatibility 8.6, but torch 1.8.1 with cuda 11.1 works. 3) When using torch 1.8.1, line 4 in file maskrcnn_benchmark/utils/imports.py should be changed to if torch._six.PY37 (I'm using python 3.7), since the torch._six in torch 1.8.1 does not have the PY3 attribute.

luckyyy00 commented 2 years ago

谢谢你的提醒!我是一所国内211大学的学生,研究SGG已经一年左右了,可以加个联系方式交流一下吗?

XuechengSun commented 2 years ago

Thanks! By the way, do the pretrained models work in the new versions of PyTorch?

catfish132 commented 2 years ago

谢谢你的提醒!我是一所国内211大学的学生,研究SGG已经一年左右了,可以加个联系方式交流一下吗? 你好,我也是学生,刚开始接触SGG,方便加一个微信交流一下嘛

noparkee commented 1 year ago

Thanks to you, I was able to solve the problem. Thanks a lot!

Yunhao-Liu commented 1 year ago

Thanks! I met different error on step1 "RuntimeError: Error compiling objects for extension", but your way can also solve my problem

narchitect commented 1 year ago

Thanks!!! i finally succeeded to build the benchmark! as regarding RuntimError while installing apex, I change gcc version into 10. my setup was win 11 rtx 3060 cuda 11.1 pytorch 1.8.1 GCC 10

Lhyshining commented 6 months ago

Thanks for your tips! But when I pretrained faster rcnn, torch said apex.amp has been integrated into torch. So if torch version >= 1.6, just replace from apex import amp with from torch.cuda import amp in program files. Samely, we dont need install cocoapi from source code, just pip install pycocotools==2.0.0 or higher version.