Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError torch related #14

Open
Jaykob opened this issue Jan 29, 2020 · 1 comment
Open

RuntimeError torch related #14

Jaykob opened this issue Jan 29, 2020 · 1 comment

Comments

@Jaykob
Copy link

Jaykob commented Jan 29, 2020

Hi!
Thanks for sharing your code with us! :-)
I'm trying to train the model using ex1_train.sh with the ModelNet40.
After a long time of training the script quit with the following error:

.../ptlk/pointlk.py", line 58, in do_forward
    a0[:, 0:3, 3] = p0_m
RuntimeError: unsupported operation: more than one element of the written-to tensor refers to a single memory location. Please clone() the tensor before performing the operation.

Can you help me find out what's going wrong here?

@Jaykob Jaykob changed the title RuntimeError tensorflow related RuntimeError torch related Jan 29, 2020
@DavidBoja
Copy link

As the error says, you can clone the tensors using the .clone() method.
Add it to lines 54 and 55 of the pointlk.py script as so:

a0 = torch.eye(4).view(1, 4, 4).expand(p0.size(0), 4, 4).to(p0).clone() # [B, 4, 4]
a1 = torch.eye(4).view(1, 4, 4).expand(p1.size(0), 4, 4).to(p1).clone() # [B, 4, 4]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants