jwwangchn / AI-TOD

Official code for "Tiny Object Detection in Aerial Images".
MIT License
193 stars 21 forks source link

Too many errors in the script generate_aitod_imgs.py #37

Closed NicolasDrapier closed 2 months ago

NicolasDrapier commented 2 months ago

Description:

I'm encountering a significant number of errors in generate_aitod_imgs.py used in our project. While the issue with missing dependencies can be resolved relatively easily, there are other problems that need addressing:

  1. Dependency Evolution:

The wwtool package has not evolved in sync with mmcv, despite the dependency being specified in the README.md. This discrepancy is causing compatibility issues.

Example
``` Traceback (most recent call last): File "/mnt/d/Datasets/AI-TOD2/generate_aitod_imgs.py", line 13, in from wwtool.datasets import Convert2COCO File "/mnt/d/Datasets/AI-TOD2/wwtool/wwtool/__init__.py", line 7, in from .visualization import * File "/mnt/d/Datasets/AI-TOD2/wwtool/wwtool/visualization/__init__.py", line 1, in from .color import color_val, COLORS File "/mnt/d/Datasets/AI-TOD2/wwtool/wwtool/visualization/color.py", line 2, in from mmcv.utils import is_str ImportError: cannot import name 'is_str' from 'mmcv.utils' (/mnt/d/Datasets/AI-TOD2/aitod-venv/lib/python3.12/site-packages/mmcv/utils/__init__.py) ```
  1. Undefined Variables:

The script references several variables that are not defined within it: small_size, large_object_size, original_class, just_keep_small, generate_small_dataset, small_object_rate. Although these variables are defined in the wwtool package, they are not being recognized in the script despite the import wwtool statement.

Steps to Reproduce:

  1. Clone the repository.
  2. Install the dependencies as per the README.md.
  3. Run the script.

Actual Behavior: The script throws errors due to undefined variables and compatibility issues between wwtool and mmcv.

Environment
``` PyTorch version: 2.4.0+cu124 Is debug build: False CUDA used to build PyTorch: 12.4 ROCM used to build PyTorch: N/A OS: Ubuntu 24.04 LTS (x86_64) GCC version: (Ubuntu 13.2.0-23ubuntu4) 13.2.0 Clang version: Could not collect CMake version: Could not collect Libc version: glibc-2.39 Python version: 3.12.3 (main, Jul 31 2024, 17:43:48) [GCC 13.2.0] (64-bit runtime) Python platform: Linux-6.8.0-41-generic-x86_64-with-glibc2.39 Is CUDA available: True CUDA runtime version: 12.0.140 CUDA_MODULE_LOADING set to: LAZY GPU models and configuration: GPU 0: NVIDIA GeForce RTX 4090 Nvidia driver version: 555.42.06 cuDNN version: Could not collect HIP runtime version: N/A MIOpen runtime version: N/A Is XNNPACK available: True CPU: Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Address sizes: 46 bits physical, 48 bits virtual Byte Order: Little Endian CPU(s): 32 On-line CPU(s) list: 0-31 Vendor ID: GenuineIntel Model name: 13th Gen Intel(R) Core(TM) i9-13900K CPU family: 6 Model: 183 Thread(s) per core: 2 Core(s) per socket: 24 Socket(s): 1 Stepping: 1 CPU(s) scaling MHz: 73% CPU max MHz: 5800.0000 CPU min MHz: 800.0000 BogoMIPS: 5990.40 Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb intel_pt sha_ni xsaveopt xsavec xgetbv1 xsaves split_lock_detect user_shstk avx_vnni dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req hfi vnmi umip pku ospke waitpkg gfni vaes vpclmulqdq tme rdpid movdiri movdir64b fsrm md_clear serialize pconfig arch_lbr ibt flush_l1d arch_capabilities Virtualization: VT-x L1d cache: 896 KiB (24 instances) L1i cache: 1.3 MiB (24 instances) L2 cache: 32 MiB (12 instances) L3 cache: 36 MiB (1 instance) NUMA node(s): 1 NUMA node0 CPU(s): 0-31 Vulnerability Gather data sampling: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling: Mitigation; Clear Register File Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization Vulnerability Spectre v2: Mitigation; Enhanced / Automatic IBRS; IBPB conditional; RSB filling; PBRSB-eIBRS SW sequence; BHI BHI_DIS_S Vulnerability Srbds: Not affected Vulnerability Tsx async abort: Not affected Versions of relevant libraries: [pip3] numpy==2.1.0 [pip3] nvidia-cublas-cu12==12.4.2.65 [pip3] nvidia-cuda-cupti-cu12==12.4.99 [pip3] nvidia-cuda-nvrtc-cu12==12.4.99 [pip3] nvidia-cuda-runtime-cu12==12.4.99 [pip3] nvidia-cudnn-cu12==9.1.0.70 [pip3] nvidia-cufft-cu12==11.2.0.44 [pip3] nvidia-curand-cu12==10.3.5.119 [pip3] nvidia-cusolver-cu12==11.6.0.99 [pip3] nvidia-cusparse-cu12==12.3.0.142 [pip3] nvidia-nccl-cu12==2.20.5 [pip3] nvidia-nvjitlink-cu12==12.4.99 [pip3] nvidia-nvtx-cu12==12.4.99 [pip3] torch==2.4.0+cu124 [pip3] torchvision==0.19.0+cu124 [pip3] triton==3.0.0 [conda] Could not collect ROCM Version: Could not collect Neuron SDK Version: N/A vLLM Version: N/A vLLM Build Flags: CUDA Archs: Not Set; ROCm: Disabled; Neuron: Disabled GPU Topology: GPU0 CPU Affinity NUMA Affinity GPU NUMA ID GPU0 X 0-31 0 N/A Legend: X = Self SYS = Connection traversing PCIe as well as the SMP interconnect between NUMA nodes (e.g., QPI/UPI) NODE = Connection traversing PCIe as well as the interconnect between PCIe Host Bridges within a NUMA node PHB = Connection traversing PCIe as well as a PCIe Host Bridge (typically the CPU) PXB = Connection traversing multiple PCIe bridges (without traversing the PCIe Host Bridge) PIX = Connection traversing at most a single PCIe bridge NV# = Connection traversing a bonded set of # NVLinks ```

Notes:

I am aware that I am not opening an issue on the wwtool repository, but since the author is the same and the errors are closely related, I believe addressing these issues here is appropriate.

What is the recommended course of action? I have rewritten part of the script, but I am now encountering another error related to the headers of TIFF files.

P.S: I try to use AI-TOD V2

Chasel-Tsui commented 2 months ago

Hi, Nicolas, could you please send me an email address, I can send you a copy of the generated images

NicolasDrapier commented 2 months ago

Hi @Chasel-Tsui, I sent you an email based on the one I found in your github homepage