cvlab-columbia / viper

Code for the paper "ViperGPT: Visual Inference via Python Execution for Reasoning"
Other
1.65k stars 115 forks source link

from maskrcnn_benchmark.engine.predictor_glip import ...... #7

Closed Tony363 closed 1 year ago

Tony363 commented 1 year ago

On line 416 of the vision_models.py, the module maskrcnn_benchmark was imported. Is it https://github.com/facebookresearch/maskrcnn-benchmark/blob/main/INSTALL.md here? Am I to install the maskrcnn module? I do not see it from the requirements.txt . I think there are several modules that the code imports with out it being in the requirements.txt?

surisdi commented 1 year ago

Hi,

The maskrcnn_benchmark library is installed when installing GLIP (it is used by GLIP). So it will be installed when you run the line python setup.py clean --all build develop --user in the README.

Could you tell me what other modules that the code imports are not installed when you run the quickstart instructions in the README document? Some modules may not directly be in the requirements.txt file but are still installed in the process.

Tony363 commented 1 year ago

Thanks for the quick reply!

May I ask which directory setup.py is located in? I couldn't seem to find it. I assume it's inside the GLIP directory?

I have already installed the required packages that I needed other than maskrcnn_benchmark. So I might not be able to track them down right now.

Also what specific model would you recommend to use instead of GLIP and BLIP2 if the model is too big for my device?

Thank you

surisdi commented 1 year ago

Yes, the file setup.py is located in the GLIP directory. Before running that command, you have to cd GLIP.

Did you clone the repository recursively, as shown in the quickstart section? The GLIP repository will not be cloned otherwise, and you will have an empty directory.

There are smaller versions of BLIP2 that you can try. We did not try any alternative for GLIP, but potentially MDETR or standard supervised object detection models (like Faster RCNN) can be used, depending on the use case.

Tony363 commented 1 year ago

Thank you for pointing out specifically about cloning the repository recursively! I wasn't aware of that! I will try to setup up the environment again. On the side note, would you know of any affordable resources that I might test out viperGPT on my own dataset? I am thinking of Kaggle TPUs but that may just be a longshot.

Tony363 commented 1 year ago
/data/tony/anaconda3/envs/vipergpt/bin/nvcc -DWITH_CUDA -I/data/tony/viper/GLIP/maskrcnn_benchmark/csrc -I/data/tony/anaconda3/envs/vipergpt/lib/python3.10/site-packages/torch/include -I/data/tony/anaconda3/envs/vipergpt/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -I/data/tony/anaconda3/envs/vipergpt/lib/python3.10/site-packages/torch/include/TH -I/data/tony/anaconda3/envs/vipergpt/lib/python3.10/site-packages/torch/include/THC -I/data/tony/anaconda3/envs/vipergpt/include -I/data/tony/anaconda3/envs/vipergpt/include/python3.10 -c /data/tony/viper/GLIP/maskrcnn_benchmark/csrc/cuda/ROIAlign_cuda.cu -o build/temp.linux-x86_64-cpython-310/data/tony/viper/GLIP/maskrcnn_benchmark/csrc/cuda/ROIAlign_cuda.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options '-fPIC' -DCUDA_HAS_FP16=1 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1011\" -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_61,code=sm_61 -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 -std=c++14
In file included from /data/tony/viper/GLIP/maskrcnn_benchmark/csrc/cuda/ROIAlign_cuda.cu:3:
/data/tony/anaconda3/envs/vipergpt/lib/python3.10/site-packages/torch/include/ATen/cuda/CUDAContext.h:10:10: fatal error: cusolverDn.h: No such file or directory
   10 | #include <cusolverDn.h>
      |          ^~~~~~~~~~~~~~
compilation terminated.
error: command '/data/tony/anaconda3/envs/vipergpt/bin/nvcc' failed with exit code 1

I would get an error like this when I run python setup.py clean --all build develop --user and maskrcnn_benchmark still won't be installed. How do I fix this issue?

surisdi commented 1 year ago

Did you run the line export PATH=/usr/local/cuda/bin:$PATH? If that is not where your cuda directory is, you may have to change it to point to your cuda installation.

Tony363 commented 1 year ago

Yes, I ran the command export PATH=/usr/local/cuda/bin:$PATH. I think my cuda directory is located some where else. I am trying which nvcc to locate the directory. However, I still can't find it. Would you happen to know how I might find the cuda directory?

surisdi commented 1 year ago

You can try using locate cuda or locate nvcc. It is usually installed under /usr/local/cuda, but maybe you have it installed as /usr/local/cuda-11.6 (or your version number). You can also check /opt/cuda and /usr/lib/nvidia-cuda-toolkit

Tony363 commented 1 year ago

ahh, even tho requirements.txt has accelerate, running the notebook would always have me run pip install bitsandbytes as well