From 5bb65433467c4956ecfea1d09b171157e9e6733e Mon Sep 17 00:00:00 2001 From: Tony Wang <72364066+Everloom-129@users.noreply.github.com> Date: Sun, 23 Jul 2023 13:08:41 +0800 Subject: [PATCH] Readme: Add more Installation details (#177) * test functionality * add more steps for installation, so the CUDA_HOME can be set correctly --- README.md | 48 +++++++++++++++++++--- test.ipynb | 114 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 157 insertions(+), 5 deletions(-) create mode 100644 test.ipynb diff --git a/README.md b/README.md index 0c13fa5..e0d3c1f 100644 --- a/README.md +++ b/README.md @@ -114,29 +114,67 @@ Marrying Grounding DINO **Note:** -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. +0. 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: +```bash +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: +```bash +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. +```bash +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: + +```bash +echo 'export CUDA_HOME=/path/to/cuda' >> ~/.bashrc +``` +after that, source the bashrc file and check CUDA_HOME: +```bash +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: +```bash +export CUDA_HOME=/usr/local/cuda +``` **Installation:** -Clone the GroundingDINO repository from GitHub. +1.Clone the GroundingDINO repository from GitHub. ```bash git clone https://github.com/IDEA-Research/GroundingDINO.git ``` -Change the current directory to the GroundingDINO folder. +2. Change the current directory to the GroundingDINO folder. ```bash cd GroundingDINO/ ``` -Install the required dependencies in the current directory. +3. Install the required dependencies in the current directory. ```bash pip install -e . ``` -Download pre-trained model weights. +4. Download pre-trained model weights. ```bash mkdir weights diff --git a/test.ipynb b/test.ipynb new file mode 100644 index 0000000..9138092 --- /dev/null +++ b/test.ipynb @@ -0,0 +1,114 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "final text_encoder_type: bert-base-uncased\n" + ] + }, + { + "data": { + "application/json": { + "ascii": false, + "bar_format": null, + "colour": null, + "elapsed": 0.014210224151611328, + "initial": 0, + "n": 0, + "ncols": null, + "nrows": null, + "postfix": null, + "prefix": "Downloading model.safetensors", + "rate": null, + "total": 440449768, + "unit": "B", + "unit_divisor": 1000, + "unit_scale": true + }, + "application/vnd.jupyter.widget-view+json": { + "model_id": "5922f34578364d36afa13de9f01254bd", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "Downloading model.safetensors: 0%| | 0.00/440M [00:00