princeton-vl / pose-ae-train

Training code for "Associative Embedding: End-to-End Learning for Joint Detection and Grouping"
BSD 3-Clause "New" or "Revised" License
373 stars 76 forks source link

Compilation error when building extensions #25

Closed guohengkai closed 6 years ago

guohengkai commented 6 years ago

Hi, when I compile the extensions, the errors occur as following. Do anyone know how to fix it? Thanks.

src/pose-ae-train/extensions/AE/src/my_lib.c: In function ‘my_lib_loss_forward’: src/pose-ae-train/extensions/AE/src/my_lib.c:15:30: error: dereferencing pointer to incomplete type const int batchsize = Tag->size[0]; ^ src/pose-ae-train/extensions/AE/src/my_lib.c:16:28: error: dereferencing pointer to incomplete type const int tag_dim = Tag->size[2]; ^ src/pose-ae-train/extensions/AE/src/my_lib.c:17:37: error: dereferencing pointer to incomplete type const int num_people = keypoints->size[1]; ^ src/pose-ae-train/extensions/AE/src/my_lib.c:18:36: error: dereferencing pointer to incomplete type const int num_joint = keypoints->size[2]; ^ src/pose-ae-train/extensions/AE/src/my_lib.c:21:42: error: dereferencing pointer to incomplete type const int kpt_strideBatch = keypoints->stride[0]; ^ src/pose-ae-train/extensions/AE/src/my_lib.c:22:43: error: dereferencing pointer to incomplete type const int kpt_stridePeople = keypoints->stride[1]; ^ src/pose-ae-train/extensions/AE/src/my_lib.c:23:42: error: dereferencing pointer to incomplete type const int kpt_strideJoint = keypoints->stride[2]; ^ src/pose-ae-train/extensions/AE/src/my_lib.c:25:36: error: dereferencing pointer to incomplete type const int tag_strideBatch = Tag->stride[0]; ^ src/pose-ae-train/extensions/AE/src/my_lib.c:26:36: error: dereferencing pointer to incomplete type const int tag_stridePoint = Tag->stride[1]; ^ src/pose-ae-train/extensions/AE/src/my_lib.c:28:42: error: dereferencing pointer to incomplete type const int output_strideBatch = output->stride[0]; ^ src/pose-ae-train/extensions/AE/src/my_lib.c:29:43: error: dereferencing pointer to incomplete type const int mean_strideBatch = mean_tags->stride[0]; ^ src/pose-ae-train/extensions/AE/src/my_lib.c:30:38: error: dereferencing pointer to incomplete type const int mean_stride = mean_tags->stride[1]; ^ src/pose-ae-train/extensions/AE/src/my_lib.c: In function ‘my_lib_loss_backward’: src/pose-ae-train/extensions/AE/src/my_lib.c:113:30: error: dereferencing pointer to incomplete type const int batchsize = Tag->size[0]; ^ src/pose-ae-train/extensions/AE/src/my_lib.c:114:28: error: dereferencing pointer to incomplete type const int tag_dim = Tag->size[2]; ^ src/pose-ae-train/extensions/AE/src/my_lib.c:115:37: error: dereferencing pointer to incomplete type const int num_people = keypoints->size[1]; ^ .......... Traceback (most recent call last): File "Python-3.7/lib/python3.7/distutils/unixccompiler.py", line 118, in _compile extra_postargs) File "Python-3.7/lib/python3.7/distutils/ccompiler.py", line 909, in spawn spawn(cmd, dry_run=self.dry_run) File "Python-3.7/lib/python3.7/distutils/spawn.py", line 36, in spawn _spawn_posix(cmd, search_path, dry_run=dry_run) File "Python-3.7/lib/python3.7/distutils/spawn.py", line 159, in _spawn_posix % (cmd, exit_status)) distutils.errors.DistutilsExecError: command 'gcc' failed with exit status 1

guohengkai commented 6 years ago

Fixed.

harsh-agar commented 6 years ago

Hi @guohengkai I'm getting a similar error. How did you fix this?

guohengkai commented 6 years ago

@harsh-agar Hi, this is because the API for torch has been changed. For example, "Tag->size[0]" --> "THCudaTensor_size(Tag, 0)".

mensaochun commented 6 years ago

@guohengkai hello, I also get this error, what should I do to solve the problem? Thank you.

harsh-agar commented 6 years ago

@mensaochun you can solve it by downgrading Torch.

pavanteja295 commented 5 years ago

@harsh-agar pytorch 0.4.0 or pytorch 0.3.1 ??

harsh-agar commented 5 years ago

@pavanteja295 pytorch 0.4.0 worked.