mmhuman3d icon indicating copy to clipboard operation
mmhuman3d copied to clipboard

Pytorch3d not compiled with GPU support

Open codeHorasan opened this issue 2 years ago • 3 comments

Hi, I have CUDA installed with me and CUDA_HOME is working fine but I am getting this error on Pytorch3d when I try to apply hmr with sample_demo.

Traceback (most recent call last): File "estimate_smpl.py", line 591, in main(args) File "estimate_smpl.py", line 489, in main single_person_with_mmdet(args, frames_iter) File "estimate_smpl.py", line 278, in single_person_with_mmdet visualize_smpl_hmr( File "C:\Users\ugur_\OneDrive\Belgeler\mmhuman3d\mmhuman3d\core\visualization\visualize_smpl.py", line 1120, in visualize_smpl_hmr return func(Ks=Ks, K=K, T=T, **kwargs) File "C:\Users\ugur_\OneDrive\Belgeler\mmhuman3d\mmhuman3d\core\visualization\visualize_smpl.py", line 1041, in render_smpl results = render_runner.render( File "C:\Users\ugur_\OneDrive\Belgeler\mmhuman3d\mmhuman3d\core\renderer\torch3d_renderer\render_runner.py", line 115, in render images_batch = renderer(indexes=indexes, **foward_params_batch) File "C:\Users\ugur_.conda\envs\open-mmlab\lib\site-packages\torch\nn\modules\module.py", line 1102, in call_impl return forward_call(*input, **kwargs) File "C:\Users\ugur\OneDrive\Belgeler\mmhuman3d\mmhuman3d\core\renderer\torch3d_renderer\smpl_renderer.py", line 182, in forward rendered_tensor = self.image_renderer( File "C:\Users\ugur_.conda\envs\open-mmlab\lib\site-packages\torch\nn\modules\module.py", line 1102, in call_impl return forward_call(*input, **kwargs) File "C:\Users\ugur\OneDrive\Belgeler\mmhuman3d\mmhuman3d\core\renderer\torch3d_renderer\mesh_renderer.py", line 71, in forward fragments = self.rasterizer(meshes_world=meshes, cameras=cameras) File "C:\Users\ugur_.conda\envs\open-mmlab\lib\site-packages\torch\nn\modules\module.py", line 1102, in call_impl return forward_call(*input, **kwargs) File "C:\Users\ugur.conda\envs\open-mmlab\lib\site-packages\pytorch3d-0.6.2-py3.8-win-amd64.egg\pytorch3d\renderer\mesh\rasterizer.py", line 240, in forward pix_to_face, zbuf, bary_coords, dists = rasterize_meshes( File "C:\Users\ugur_.conda\envs\open-mmlab\lib\site-packages\pytorch3d-0.6.2-py3.8-win-amd64.egg\pytorch3d\renderer\mesh\rasterize_meshes.py", line 234, in rasterize_meshes pix_to_face, zbuf, barycentric_coords, dists = RasterizeFaceVerts.apply( File "C:\Users\ugur.conda\envs\open-mmlab\lib\site-packages\pytorch3d-0.6.2-py3.8-win-amd64.egg\pytorch3d\renderer\mesh\rasterize_meshes.py", line 308, in forward pix_to_face, zbuf, barycentric_coords, dists = _C.rasterize_meshes( RuntimeError: Not compiled with GPU support

Thats the command line code: python estimate_smpl.py configs/hmr/resnet50_hmr_pw3d.py configs/hmr/resnet50_hmr_pw3d-04f40f58_20211201.pth --single_person_demo --det_config faster_rcnn_r50_fpn_coco.py --det_checkpoint faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth --input_path demo/resources/S1_Directions_1.54138969_000001.jpg --output output/ --show_path output/ --device cuda

codeHorasan avatar Jul 16 '22 15:07 codeHorasan

I also have the same problem with PyTorch3D, which I haven't solved. As a temporary solution, I commented out pytorch3d imports. Luckily, I didn't need them, but this requires a permanent solution.

kristijanbartol avatar Jul 18 '22 08:07 kristijanbartol

You've got to install the correct version of torch3d based on python, cuda & torch versions. Find it based on this:

https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/{py38_cu101_pyt160}/download.html

More details are in the installation instructions of torch3d.

rlleshi avatar Jul 18 '22 10:07 rlleshi

Thanks guy for responding. I was able to solve the issue by removing pytorch3d and reinstalling it accordingly. In my initial installation, I forgot to do:

"After any necessary patching, you can go to "x64 Native Tools Command Prompt for VS 2019" to compile and install"

cd pytorch3d python3 setup.py install

after installing it from local clone. @kristijanbartol that's how I was able to solve it.

codeHorasan avatar Jul 18 '22 12:07 codeHorasan

@codeHorasan @kristijanbartol @rlleshi Thanks all for the discussion, we have updated the install.md to include installing from source instructions in this PR.

caizhongang avatar Aug 12 '22 07:08 caizhongang