Coder Social home page Coder Social logo

Comments (5)

matheusgadelha avatar matheusgadelha commented on September 21, 2024 2

Just figured out, this was no issue with the chamferDist implementation but with the way @Colin97 is testing. From that code, x and y remain in cpu. According to the documentation, .cuda() returns a copy of the tensor in the gpu unless the tensor is already in it, so the right way to do would be to write:

x = x.cuda()
y = y.cuda()
dis1, dis2 = distChamfer(x, y)

So, just make sure your tensors are in the GPU before passing to chamferDist and it should work.

from atlasnet.

ThibaultGROUEIX avatar ThibaultGROUEIX commented on September 21, 2024

Hi @Colin97 ,
can you also specify your python version please ?
The fastest solution is to try other combinations : Python 3.7 - cuda 10 - pytorch 1 is my setup. Other people in my lab use Python 3.6 - cuda 10 - pytorch 1.
If none of the above work for you, can you paste your error ?
best regards,
Thibault

from atlasnet.

matheusgadelha avatar matheusgadelha commented on September 21, 2024

I am having the same error. Python 3.6, cuda 10.0, pytorch 1.

THCudaCheck FAIL file=/pytorch/aten/src/THC/THCCachingHostAllocator.cpp line=265 error=77 : an illegal memory access was encountered
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.6/dist-packages/torch/tensor.py", line 66, in __repr__
    return torch._tensor_str._str(self)
  File "/usr/local/lib/python3.6/dist-packages/torch/_tensor_str.py", line 277, in _str
    tensor_str = _tensor_str(self, indent)
  File "/usr/local/lib/python3.6/dist-packages/torch/_tensor_str.py", line 195, in _tensor_str
    formatter = _Formatter(get_summarized_data(self) if summarize else self)
  File "/usr/local/lib/python3.6/dist-packages/torch/_tensor_str.py", line 228, in get_summarized_data
    return torch.stack([get_summarized_data(x) for x in (start + end)])
  File "/usr/local/lib/python3.6/dist-packages/torch/_tensor_str.py", line 228, in <listcomp>
    return torch.stack([get_summarized_data(x) for x in (start + end)])
  File "/usr/local/lib/python3.6/dist-packages/torch/_tensor_str.py", line 221, in get_summarized_data
    return torch.cat((self[:PRINT_OPTS.edgeitems], self[-PRINT_OPTS.edgeitems:]))
RuntimeError: cuda runtime error (77) : an illegal memory access was encountered at /pytorch/aten/src/THC/THCCachingHostAllocator.cpp:26

from atlasnet.

Colin97 avatar Colin97 commented on September 21, 2024

Just figured out, this was no issue with the chamferDist implementation but with the way @Colin97 is testing. From that code, x and y remain in cpu. According to the documentation, .cuda() returns a copy of the tensor in the gpu unless the tensor is already in it, so the right way to do would be to write:

x = x.cuda()
y = y.cuda()
dis1, dis2 = distChamfer(x, y)

So, just make sure your tensors are in the GPU before passing to chamferDist and it should work.

u r right!

from atlasnet.

ThibaultGROUEIX avatar ThibaultGROUEIX commented on September 21, 2024

Thanks @matheusgadelha !
--Thibault

from atlasnet.

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.