SimonGiebenhain / MonoNPHM

[CVPR 2024 Highlight]
https://simongiebenhain.github.io/MonoNPHM/
Other
100 stars 17 forks source link

“Solving Environment” Delay and incompatible cuda versions in Installation #10

Closed Dharmendra04 closed 1 month ago

Dharmendra04 commented 1 month ago

Successfully installed CFFI-1.17.1 Cython-3.0.11 MarkupSafe-2.1.5 Pillow-10.4.0 PyOpenGL-3.1.0 absl-py-2.1.0 albumentations-1.3.1 asttokens-2.4.1 attrs-24.2.0 certifi-2024.8.30 chardet-5.2.0 charset-normalizer-3.3.2 chumpy-0.70 click-8.1.7 coloredlogs-15.0.1 comm-0.2.2 contourpy-1.3.0 cycler-0.12.1 dearpygui-1.11.1 decorator-5.1.1 distinctipy-1.3.4 docker-pycreds-0.4.0 docstring-parser-0.16 dreifus-0.1.22 easydict-1.13 environs-11.0.0 eval-type-backport-0.2.0 exceptiongroup-1.2.2 executing-2.1.0 face_alignment-1.4.1 ffmpeg-1.4 filelock-3.16.0 flatbuffers-24.3.25 fonttools-4.53.1 freetype-py-2.5.1 fsspec-2024.9.0 gitdb-4.0.11 gitpython-3.1.43 grpcio-1.66.1 huggingface_hub-0.24.6 humanfriendly-10.0 idna-3.8 imageio-2.35.1 importlib-metadata-8.4.0 importlib-resources-6.4.4 insightface-0.7 ipython-8.18.1 ipywidgets-8.1.5 jax-0.4.30 jaxlib-0.4.30 jedi-0.19.1 jinja2-3.1.4 joblib-1.4.2 jupyterlab-widgets-3.0.13 kiwisolver-1.4.7 lazy-loader-0.4 llvmlite-0.43.0 loguru-0.7.2 markdown-3.7 markdown-it-py-3.0.0 marshmallow-3.22.0 matplotlib-3.9.2 matplotlib-inline-0.1.7 mdurl-0.1.2 mediapipe-0.10.15 mediapy-1.2.2 ml-dtypes-0.4.0 mpmath-1.3.0 networkx-3.2.1 numba-0.60.0 numpy-1.23.0 nvidia-cublas-cu12-12.1.3.1 nvidia-cuda-cupti-cu12-12.1.105 nvidia-cuda-nvrtc-cu12-12.1.105 nvidia-cuda-runtime-cu12-12.1.105 nvidia-cudnn-cu12-9.1.0.70 nvidia-cufft-cu12-11.0.2.54 nvidia-curand-cu12-10.3.2.106 nvidia-cusolver-cu12-11.4.5.107 nvidia-cusparse-cu12-12.1.0.106 nvidia-nccl-cu12-2.20.5 nvidia-nvjitlink-cu12-12.6.68 nvidia-nvtx-cu12-12.1.105 onnx-1.16.2 onnxruntime-1.19.2 opencv-contrib-python-4.10.0.84 opencv-python-4.10.0.84 opencv-python-headless-4.10.0.84 opt-einsum-3.3.0 packaging-24.1 parso-0.8.4 pexpect-4.9.0 platformdirs-4.3.2 point_cloud_utils-0.31.0 pooch-1.8.2 prettytable-3.11.0 prompt-toolkit-3.0.47 protobuf-4.25.4 psutil-6.0.0 ptyprocess-0.7.0 pure-eval-0.2.3 pycparser-2.22 pyfacer-0.0.4 pyglet-2.0.17 pygments-2.18.0 pymcubes-0.1.6 pymeshlab-2023.12.post1 pyparsing-3.1.4 pyrender-0.1.45 python-dateutil-2.9.0.post0 python-dotenv-1.0.1 pyvista-0.44.1 pyyaml-6.0.2 qudida-0.0.4 requests-2.32.3 rich-13.8.0 safetensors-0.4.5 scikit-image-0.24.0 scikit-learn-1.5.1 scipy-1.13.1 scooby-0.10.0 sentry-sdk-2.13.0 setproctitle-1.3.3 shtab-1.7.1 six-1.16.0 smmap-5.0.1 sounddevice-0.5.0 stack-data-0.6.3 sympy-1.13.2 tensorboard-2.17.1 tensorboard-data-server-0.7.2 threadpoolctl-3.5.0 tifffile-2024.8.30 timm-1.0.9 torch-2.4.1 torchvision-0.19.1 tqdm-4.66.5 traitlets-5.14.3 trimesh-4.4.9 triton-3.0.0 typing-extensions-4.12.2 tyro-0.8.10 urllib3-2.2.2 validators-0.34.0 vtk-9.3.1 wandb-0.17.9 wcwidth-0.2.13 werkzeug-3.0.4 widgetsnbextension-4.0.13 zipp-3.20.1

As shown in above installation message, Pytroch and Cuda is already getting installed when I run the below code, conda env create -f environment.yml

Then why I need to reinstall pytorch and cuda 11.7 again using the below code.

Install pytorch with CUDA support conda install pytorch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2 pytorch-cuda=11.7 -c pytorch -c nvidia

Most importantly when using conda install method, even for a day it is not showing any progression, as it is also showing the message : solving the environment

Any alternative method to install pytorch and pytorch-3d? can i use pip to install pytorch?

Dharmendra04 commented 1 month ago

I have used pip installation instead of conda, to install pytorch, pytorch3d, pyg, fvcore, and iopath.

When I run the inference code for one of the data from the demo FFHQ data, I receive the following error.

Code: python scripts/inference/rec.py --model_type nphm --exp_name pretrained_mononphm --ckpt 2500 --seq_name 00059 --intrinsics_provided

Error:

    "decoder": {
        "decoder_nloc": 65,
        "ex": {
            "hidden_dim": 400,
            "lat_dim_ex": 100,
            "lat_dim_id": 16,
            "mode": "compress",
            "nhyper": 2,
            "nlayers": 6
        },
        "id": {
            "blend_std": 3.75,
            "gnn": {
                "hidden_dim_app": 200,
                "hidden_dim_geo": 200,
                "nfreq_bands_app": 0,
                "nfreq_bands_geo": 0,
                "nlayers_app": 4,
                "nlayers_geo": 4
            },
            "head": {
                "hidden_dim_app": 128,
                "hidden_dim_geo": 128,
                "lat_dim_app_aggr": 256,
                "lat_dim_geo_aggr": 256,
                "nlayers_app": 2,
                "nlayers_geo": 2
            },
            "lat_dim_glob": 64,
            "lat_dim_glob_app": 64,
            "lat_dim_loc_app": 32,
            "lat_dim_loc_geo": 32,
            "nloc": 65,
            "nneigh": 12,
            "nsymm_pairs": 30
        }
    },
    "training": {
        "batch_size": 16,
        "ckpt_interval": 500,
        "grad_clip": 1.0,
        "grad_clip_lat": 1.0,
        "lambdas": {
            "anchors": 7.5,
            "color": 1.0,
            "corresp": 1000.0,
            "eikonal": 0.15,
            "hyper": 0.01,
            "loss_neutral_zero": 0.001,
            "loss_reg_zero": 0.0025,
            "lpips": 0.1,
            "middle_dist": 0.0,
            "middle_dist_app": 0,
            "normals": 0.3,
            "reg_app": 0.005,
            "reg_app_var": 3e-07,
            "reg_expr": 0.05,
            "reg_expr_var": 3e-08,
            "reg_shape": 0.01,
            "reg_shape_var": 3e-08,
            "space_sdf": 0.01,
            "surf_sdf": 1.0,
            "symm_dist": 0.01,
            "symm_dist_app": 0.0001
        },
        "loss_type": "igr",
        "lr": 0.0005,
        "lr_decay_factor": 0.5,
        "lr_decay_factor_lat": 0.5,
        "lr_decay_interval": 500,
        "lr_decay_interval_lat": 500,
        "lr_lat": 0.002,
        "lr_lat_expr": 0.01,
        "mode": "shape_space",
        "npatches_per_batch": 1,
        "npoints_corresp": 250,
        "npoints_face": 1000,
        "npoints_non_face": 250,
        "npoints_off_surface": 250,
        "sigma_near": 0.01,
        "weight_decay": 0.0005
    }
}
FOUND 1 GPUs
ANCHORS HAVE SHAPE:  torch.Size([1, 1, 65, 3])
creating DeepSDF with...
lat dim 116
hidden_dim 400
Creating DeepSDF with input dim f119, hidden_dim f400 and output_dim 5
Loading intrinsics from JSON
/home/dharmendra/anaconda3/envs/mononphm/lib/python3.9/site-packages/numpy/core/fromnumeric.py:3432: RuntimeWarning: Mean of empty slice.
  return _methods._mean(a, axis=axis, dtype=dtype,
/home/dharmendra/anaconda3/envs/mononphm/lib/python3.9/site-packages/numpy/core/_methods.py:190: RuntimeWarning: invalid value encountered in double_scalars
  ret = ret.dtype.type(ret / rcount)
USING EPOCH MULT OF: 1
Traceback (most recent call last):
  File "/home/dharmendra/Desktop/MonoNPHM/scripts/inference/rec.py", line 194, in <module>
    tyro.cli(main)
  File "/home/dharmendra/anaconda3/envs/mononphm/lib/python3.9/site-packages/tyro/_cli.py", line 229, in cli
    return run_with_args_from_cli()
  File "/home/dharmendra/Desktop/MonoNPHM/scripts/inference/rec.py", line 185, in main
    inverse_rendering(n3dmm, seq_name, _expressions, n_expr,
  File "/home/dharmendra/Desktop/MonoNPHM/scripts/inference/rec.py", line 59, in inverse_rendering
    track(wrapped_net, cfg, seq_name, expressions,
  File "/home/dharmendra/Desktop/MonoNPHM/src/mononphm/photometric_tracking/tracking.py", line 1337, in track
    out_dict = tracker.idr(in_dict, condition, skip_render=False, neus_variance=variance,
  File "/home/dharmendra/anaconda3/envs/mononphm/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1553, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/home/dharmendra/anaconda3/envs/mononphm/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1562, in _call_impl
    return forward_call(*args, **kwargs)
  File "/home/dharmendra/Desktop/MonoNPHM/src/mononphm/photometric_tracking/rendering.py", line 213, in forward
    points, net_values, steps = self.ray_tracer(sdf=lambda x: self.implicit_network(x, condition, include_color=False),
  File "/home/dharmendra/anaconda3/envs/mononphm/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1553, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/home/dharmendra/anaconda3/envs/mononphm/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1562, in _call_impl
    return forward_call(*args, **kwargs)
  File "/home/dharmendra/Desktop/MonoNPHM/src/mononphm/photometric_tracking/rendering.py", line 91, in forward
    min_mask_points, min_mask_dist, sampled_points, net_values, steps = self.minimal_sdf_points(num_pixels, sdf, cam_loc, ray_directions, mask_intersect,
  File "/home/dharmendra/Desktop/MonoNPHM/src/mononphm/photometric_tracking/rendering.py", line 155, in minimal_sdf_points
    mask_net_out_all.append(sdf(pnts))
  File "/home/dharmendra/Desktop/MonoNPHM/src/mononphm/photometric_tracking/rendering.py", line 213, in <lambda>
    points, net_values, steps = self.ray_tracer(sdf=lambda x: self.implicit_network(x, condition, include_color=False),
  File "/home/dharmendra/anaconda3/envs/mononphm/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1553, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/home/dharmendra/anaconda3/envs/mononphm/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1562, in _call_impl
    return forward_call(*args, **kwargs)
  File "/home/dharmendra/Desktop/MonoNPHM/src/mononphm/photometric_tracking/wrapper.py", line 15, in forward
    result = self.monoNPHM({'queries': positions}, cond=condition, skip_color=not include_color, return_grad=return_grad)
  File "/home/dharmendra/anaconda3/envs/mononphm/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1553, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/home/dharmendra/anaconda3/envs/mononphm/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1562, in _call_impl
    return forward_call(*args, **kwargs)
  File "/home/dharmendra/Desktop/MonoNPHM/src/mononphm/models/neural3dmm.py", line 130, in forward
    pred = self.id_model(in_dict)
  File "/home/dharmendra/anaconda3/envs/mononphm/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1553, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/home/dharmendra/anaconda3/envs/mononphm/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1562, in _call_impl
    return forward_call(*args, **kwargs)
  File "/home/dharmendra/Desktop/MonoNPHM/src/mononphm/models/canonical_space.py", line 541, in forward
    out = self.propagate(edge_index,
TypeError: propagate() got an unexpected keyword argument 'glob_feats_color'

Why glob_feats_color is not recognized by the function, is it related to the pytroch 3d pip installation or some thing related to the given code and its attribute.