Git Product home page Git Product logo

connected_components_pytorch's People

Contributors

zsef123 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

connected_components_pytorch's Issues

error: ‘atomicMin’ was not declared in this scope

I tried to compile your code with my c++ code.
However I get the error:

error: ‘atomicMin’ was not declared in this scope

Could you help me?

My CMakeLists looks like this

cmake_minimum_required(VERSION 3.0.0)
project(TTEST VERSION 0.1.0)

include(CTest)
enable_testing()
set(Torch_DIR "/path/to/torch/share/cmake/Torch")
find_package(Torch REQUIRED)
message(STATUS "Torch INCLUDE_DIR:${TORCH_INCLUDE_DIRS}")
message(STATUS "Torch LIBRARIES:${TORCH_LIBRARIES}")

enable_language(CUDA)
message(STATUS "CUDA INCLUDE_DIR:${CUDA_INCLUDE_DIRS}")
message(STATUS "CUDA LIBRARIES:${CUDA_LIBRARIES}")

include_directories("./include") #directory of buf.h
add_executable(TTEST main.cpp buf_3d.cu)
target_link_libraries(TTEST ${TORCH_LIBRARIES} ${CUDA_LIBRARIES})

PyTorch 1.9

Hi, thanks for this work... I tried installing it with the latest version of pytorch 1.9, but it doesn't work.
Do you plan to update this to run on the latest version?

Many thanks!

Invalid output is provided when input is not contiguous

If the 2D code is applied on a tensor that is a 2D slice of a larger tensor, e.g.

x.shape == [B, H, W, C]

correct_out = connected_components_labeling(x[0, :, :, 0].contiguous())
incorrect_out = connected_components_labeling(x[0, :, :, 0])

the expected output correct_out:
image

then incorrect_out will be a weird strided version of the correct_out:
image

the input was generated as follows, reusing the example code:
x = torch.tensor(cleared_copy).to("cuda", torch.uint8)[None, :, :, None].repeat(1024, 1, 1, 2)

Fixes

The quick fix is to call .contiguous() on every slice, the correct fix would be to either throw an error if the input is not contiguous or take the tensor strides into consideration on the cuda backend.

Hope this might help someone who got unexpected results.
Nevertheless, this implementations is very quick and is an awesome starting point, so thank you! <3

update for new cuda?

Hello,

I am interested in updating your tool to ensure its compatibility with the programming environment expected in 2024, including support for CUDA 11.8. Could you provide guidance on the necessary modifications or steps required to achieve this?

Thank you for your time and support.

Label Name?

I am not firm with the cuda language. so sorry for that question: How are the label-idx created?

I would expect label to be [0, 1, 2 ....n] but got [0, 1, 34534, 340394]

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.