muelea / shapy

CVPR 2022 - Official code repository for the paper: Accurate 3D Body Shape Regression using Metric and Semantic Attributes.
https://shapy.is.tue.mpg.de/
319 stars 47 forks source link

Request code changes to compatible with higher Python version or at least higher Pytorch version #25

Closed ntrnghia closed 7 months ago

ntrnghia commented 1 year ago

Hi,

The shapy code use Python 3.8 with Pytorch 1.7.1. All of them are old compare to Python 3.11.3 and Pytorch 2.0.1 right now. Can you consider upgrade Python version, or at least Pytorch version?

Pytorch version 1.7.1 is not compatible with newer GPU (I am using RTX 3080), and when I tried newer Pytorch version, for example Pytorch 1.8, I got this error during running regressor:

Traceback (most recent call last): File "demo.py", line 24, in from human_shape.models.build import build_model File "/home/csgrad/ngnguyen/shapy/regressor/human_shape/models/init.py", line 1, in from .build import build_model File "/home/csgrad/ngnguyen/shapy/regressor/human_shape/models/build.py", line 10, in from .body_heads import build_body_head, BODY_HEAD_REGISTRY File "/home/csgrad/ngnguyen/shapy/regressor/human_shape/models/body_heads/init.py", line 3, in from .body_heads import * File "/home/csgrad/ngnguyen/shapy/regressor/human_shape/models/body_heads/body_heads.py", line 13, in from ..common.iterative_regressor import HMRLikeRegressor File "/home/csgrad/ngnguyen/shapy/regressor/human_shape/models/common/iterative_regressor.py", line 21, in from body_measurements import BodyMeasurements File "/home/csgrad/ngnguyen/env2/lib/python3.8/site-packages/mesh_mesh_intersection-0.2.0-py3.8-linux-x86_64.egg/body_measurements/init.py", line 1, in from .body_measurements import BodyMeasurements File "/home/csgrad/ngnguyen/env2/lib/python3.8/site-packages/mesh_mesh_intersection-0.2.0-py3.8-linux-x86_64.egg/body_measurements/body_measurements.py", line 6, in from mesh_mesh_intersection import MeshMeshIntersection File "/home/csgrad/ngnguyen/env2/lib/python3.8/site-packages/mesh_mesh_intersection-0.2.0-py3.8-linux-x86_64.egg/mesh_mesh_intersection/init.py", line 18, in from .mesh_mesh_intersection import MeshMeshIntersection File "/home/csgrad/ngnguyen/env2/lib/python3.8/site-packages/mesh_mesh_intersection-0.2.0-py3.8-linux-x86_64.egg/mesh_mesh_intersection/mesh_mesh_intersection.py", line 29, in import mesh_mesh_intersect_cuda ImportError: /home/csgrad/ngnguyen/env2/lib/python3.8/site-packages/mesh_mesh_intersection-0.2.0-py3.8-linux-x86_64.egg/mesh_mesh_intersect_cuda.cpython-38-x86_64-linux-gnu.so: undefined symbol: _ZN6caffe28TypeMeta21_typeMetaDataInstanceIN3c107complexIfEEEEPKNS_6detail12TypeMetaDataEv

It seems your mesh_mesh_intersect packages not compatible with Pytorch 1.8 or higher. Please consider update your mesh_mesh_intersect packages to run with later Pytorch version, or if posible further, update your code with newer python version.

Thank you

muelea commented 1 year ago

Hi, thanks for your request and the pointer. I don't know when I'll be able to update the code, but will add it to my todo list.

zmhsmart commented 7 months ago

Have you solved it? I am using a 3090 graphics card and it still shows incompatibility. How should I solve this problem?

ntrnghia commented 7 months ago

Have you solved it? I am using a 3090 graphics card and it still shows incompatibility. How should I solve this problem?

I solved it. Try to setup and install follow this notebook (link in README): https://colab.research.google.com/drive/16b5bgRrkdMkI7VILa8GS3m6yQeLH2xGI?usp=sharing

zmhsmart commented 7 months ago

Traceback (most recent call last): File "demo.py", line 433, in main(cfg, show=show, demo_output_folder=output_folder, pause=pause, File "/home/pbc/miniconda3/envs/shapy/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 26, in decorate_context return func(*args, kwargs) File "demo.py", line 232, in main model_output = model(body_imgs, body_targets, full_imgs=full_imgs, File "/home/pbc/miniconda3/envs/shapy/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl result = self.forward(*input, *kwargs) File "/home/pbc/project/inference/Generate_standard_body_shape/shapy-master/regressor/human_shape/models/common/iterative_regressor.py", line 636, in forward features = self.compute_features(images, extra_features=extra_features) File "/home/pbc/project/inference/Generate_standard_body_shape/shapy-master/regressor/human_shape/models/common/iterative_regressor.py", line 619, in compute_features feat_dict = self.backbone(images) File "/home/pbc/miniconda3/envs/shapy/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl result = self.forward(input, kwargs) File "/home/pbc/project/inference/Generate_standard_body_shape/shapy-master/regressor/human_shape/models/backbone/hrnet.py", line 429, in forward x = self.relu(x) File "/home/pbc/miniconda3/envs/shapy/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _callimpl result = self.forward(*input, **kwargs) File "/home/pbc/miniconda3/envs/shapy/lib/python3.8/site-packages/torch/nn/modules/activation.py", line 102, in forward return F.relu(input, inplace=self.inplace) File "/home/pbc/miniconda3/envs/shapy/lib/python3.8/site-packages/torch/nn/functional.py", line 1134, in relu result = torch.relu(input) RuntimeError: CUDA error: no kernel image is available for execution on the device

After completing the above operation, I encountered the above error. How should I solve it? Thank you very much.