Git Product home page Git Product logo

Comments (9)

lanhas avatar lanhas commented on June 9, 2024

image

from open-groundingdino.

BIGBALLON avatar BIGBALLON commented on June 9, 2024

Hi, @formance, plz make sure you build the CUDA ops following the README.md :

pip install -r requirements.txt 
cd models/GroundingDINO/ops
python setup.py build install
# unit test (should see all checking is True)
python test.py

from open-groundingdino.

formance avatar formance commented on June 9, 2024

Hi, @formance, plz make sure you build the CUDA ops following the README.md :

pip install -r requirements.txt 
cd models/GroundingDINO/ops
python setup.py build install
# unit test (should see all checking is True)
python test.py

i have done this step,
image
but in unit test, cuda out of memory
image
environment: pytorch 2.0.1, cuda 11.7, python 3.10.11

from open-groundingdino.

BIGBALLON avatar BIGBALLON commented on June 9, 2024

Hi, @formance, glad to hear you compiled it successfully.

this test.py file will test ops for channels 30 to 3096:

if __name__ == '__main__':
check_forward_equal_with_pytorch_double()
check_forward_equal_with_pytorch_float()
for channels in [30, 32, 64, 71, 1025, 2048, 3096]:
check_gradient_numerical(channels, True, True, True)

According to your log, 30, 32, 64, 71, and 1025 can all run normally. So maybe the error is caused by the fact that RTX4090 only has 20G GPU memory and V100 has 32G memory. It seems that your operator was compiled successfully, you can continue to try the following steps to see if everything works properly.

from open-groundingdino.

formance avatar formance commented on June 9, 2024

Hi, @formance, glad to hear you compiled it successfully.

this test.py file will test ops for channels 30 to 3096:

if __name__ == '__main__':
check_forward_equal_with_pytorch_double()
check_forward_equal_with_pytorch_float()
for channels in [30, 32, 64, 71, 1025, 2048, 3096]:
check_gradient_numerical(channels, True, True, True)

According to your log, 30, 32, 64, 71, and 1025 can all run normally. So maybe the error is caused by the fact that RTX4090 only has 20G GPU memory and V100 has 32G memory. It seems that your operator was compiled successfully, you can continue to try the following steps to see if everything works properly.

then why erro occured when training
image

from open-groundingdino.

BIGBALLON avatar BIGBALLON commented on June 9, 2024

from https://github.com/IDEA-Research/GroundingDINO/blob/60d796825e1266e56f7e4e9e00e88de662b67bd3/README.md

# your .bashrc file
export CUDA_HOME=/usr/local/cuda-11.8
export PATH=/usr/local/cuda-11.8/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-11.8/lib64:$LD_LIBRARY_PATH

🛠️ Install

Note:

  1. If you have a CUDA environment, please make sure the environment variable CUDA_HOME is set. It will be compiled under CPU-only mode if no CUDA available.

Please make sure following the installation steps strictly, otherwise the program may produce:

NameError: name '_C' is not defined

If this happened, please reinstalled the groundingDINO by reclone the git and do all the installation steps again.

how to check cuda:

echo $CUDA_HOME

If it print nothing, then it means you haven't set up the path/

Run this so the environment variable will be set under current shell.

export CUDA_HOME=/path/to/cuda-11.3

Notice the version of cuda should be aligned with your CUDA runtime, for there might exists multiple cuda at the same time.

If you want to set the CUDA_HOME permanently, store it using:

echo 'export CUDA_HOME=/path/to/cuda' >> ~/.bashrc

after that, source the bashrc file and check CUDA_HOME:

source ~/.bashrc
echo $CUDA_HOME

In this example, /path/to/cuda-11.3 should be replaced with the path where your CUDA toolkit is installed. You can find this by typing which nvcc in your terminal:

For instance,
if the output is /usr/local/cuda/bin/nvcc, then:

export CUDA_HOME=/usr/local/cuda

from open-groundingdino.

formance avatar formance commented on June 9, 2024

from https://github.com/IDEA-Research/GroundingDINO/blob/60d796825e1266e56f7e4e9e00e88de662b67bd3/README.md

# your .bashrc file
export CUDA_HOME=/usr/local/cuda-11.8
export PATH=/usr/local/cuda-11.8/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-11.8/lib64:$LD_LIBRARY_PATH

🛠️ Install

Note:

  1. If you have a CUDA environment, please make sure the environment variable CUDA_HOME is set. It will be compiled under CPU-only mode if no CUDA available.

Please make sure following the installation steps strictly, otherwise the program may produce:

NameError: name '_C' is not defined

If this happened, please reinstalled the groundingDINO by reclone the git and do all the installation steps again.

how to check cuda:

echo $CUDA_HOME

If it print nothing, then it means you haven't set up the path/

Run this so the environment variable will be set under current shell.

export CUDA_HOME=/path/to/cuda-11.3

Notice the version of cuda should be aligned with your CUDA runtime, for there might exists multiple cuda at the same time.

If you want to set the CUDA_HOME permanently, store it using:

echo 'export CUDA_HOME=/path/to/cuda' >> ~/.bashrc

after that, source the bashrc file and check CUDA_HOME:

source ~/.bashrc
echo $CUDA_HOME

In this example, /path/to/cuda-11.3 should be replaced with the path where your CUDA toolkit is installed. You can find this by typing which nvcc in your terminal:

For instance, if the output is /usr/local/cuda/bin/nvcc, then:

export CUDA_HOME=/usr/local/cuda

i hava done this, but same error occured. maybe i know why.
image
the installed module name is not groundingdino._C ,is MultiScaleDeformableAttention
image
i think u should fix it.

from open-groundingdino.

BIGBALLON avatar BIGBALLON commented on June 9, 2024

This PR fixed this issue

#10

from open-groundingdino.

formance avatar formance commented on June 9, 2024

thanks.

from open-groundingdino.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.