question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

hi tnx for implementation im using forked orginal ReDet i need add Poly IoU Loss but in adding ext i dont know how to that in colab cell i put this:

 #!/usr/bin/env python
import os
import subprocess
import time
# from setuptools import find_packages, setup


import torch
from torch.utils.cpp_extension import (BuildExtension, CppExtension,
                                       CUDAExtension)
 
 
 
 def make_cuda_ext(name, module, sources, sources_cuda=[]):

    define_macros = []
    extra_compile_args = {'cxx': []}

    if torch.cuda.is_available() or os.getenv('FORCE_CUDA', '0') == '1':
        define_macros += [('WITH_CUDA', None)]
        extension = CUDAExtension
        extra_compile_args['nvcc'] = [
            '-D__CUDA_NO_HALF_OPERATORS__',
            '-D__CUDA_NO_HALF_CONVERSIONS__',
            '-D__CUDA_NO_HALF2_OPERATORS__',
        ]
        sources += sources_cuda
    else:
        print(f'Compiling {name} without CUDA')
        extension = CppExtension
        # raise EnvironmentError('CUDA is required to compile MMDetection!')

    return extension(
        name=f'{module}.{name}',
        sources=[os.path.join(*module.split('.'), p) for p in sources],
        define_macros=define_macros,
        extra_compile_args=extra_compile_args)

  setup(
      ext_modules=[
                      make_cuda_ext(
                        name='convex_ext',
                        module='mmdet.ops.convex',
                        sources=[
                            'src/convex_cpu.cpp',
                            'src/convex_ext.cpp'
                        ],
                        sources_cuda=['src/convex_cuda.cu']),
               ],
        cmdclass={'build_ext': BuildExtension},
        zip_safe=False
        )

and got err:

File "<ipython-input-44-a399c1bfcad4>", line 38
    setup(
          ^
IndentationError: unindent does not match any outer indentation level

i want add it seperatly what should i do??

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jbwang1997commented, Sep 20, 2021

Hi, I think you can imitate the setup.py in your repo’s roialign. You just need to replace the .cpp and .cu files. Then, add the setup command in the compile.sh.

i made a setup.py

like this ;

from setuptools import setup
from torch.utils.cpp_extension import BuildExtension, CUDAExtension

setup(
    name='riroi_align_cuda',
    ext_modules=[
        CUDAExtension('convex_ext', [
            'src/convex_cpu.cpp',
            'src/convex_ext.cpp',
        ],
        sources_cuda=['src/convex_cuda.cu']
        ),
    ],
    cmdclass={'build_ext': BuildExtension})

and add it in compile.sh like this;

echo "Building convex op..."
cd ../convex
if [ -d "build" ]; then
    rm -r build
fi
$PYTHON setup.py build_ext --inplace

is it true??

the name='riroi_align_cuda' should change to name='convert_ext’. the .cu files should also in CUDAExtension and delete the sources_cuda.

0reactions
jbwang1997commented, Sep 28, 2021

This error appeared in the assigner. This is not the error of PolyIoULoss.

It seems you feed an image without ground truth in the model.

Read more comments on GitHub >

github_iconTop Results From Across the Web

2322282 Urostomy Pouch Convex Ext Wear 5/8"x1-5/16 ...
Buy 2322282 Urostomy Pouch Convex Ext Wear 5/8"x1-5/16" 10 Per Box sold as Box Pt# 12432 by Coloplast Corp on Amazon.com ✓ FREE...
Read more >
COL14246 Barrier Skin Convex Ext Wear Cut To Fit 5/8-1 5/16
Extra is a highly cohesive adhesive formulation. This means the barrier itself remains intact over time and minimal erosion/washing out occurs which helps ......
Read more >
Assura Convex Ext Extnd Wear 2pc Skin Barrier Ctf - CT 14243,CT ...
Coloplast Assura Convex Extra-Extended Wear Skin Barrier. Belt loops remain intact over time and minimal erosion occurs which helps increase wear time.
Read more >
2322282 Urostomy Pouch Convex Ext Wear 5/8"x1-5 ... - eBay
2322282 Urostomy Pouch Convex Ext Wear 5/8"x1-5/16" 10 Per Box sold as Box Pt# 12432 by Coloplast Corp. USE TITLE ONLY. (cannister) TU....
Read more >
Coloplast 12433 - POUCH UROSTOMY CONVEX EXT WEAR 11IN ...
Coloplast # 12433 - POUCH UROSTOMY CONVEX EXT WEAR 11IN 10/BX. Part Number Coloplast 12433. SKU Number CIA3018351. Sell Unit BOX. Ships Within...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found