Closed nicholaslocascio closed 1 year ago
Hi!
Thanks for pointing that out. Indeed some files were missing. The install instructions and files are updated.
Question 1: Edit: I just figured out that the data folder + script were missing. It's updated now. If the script doesn't work you can manually register and download the data from our website. Install instructions are updated.
Question 2: If don't specify the CUDA version, pip install torch==1.7.1 torchvision==0.8.2
will use CUDA 10.2, see here. Only CUDA 10.2 was tested, but CUDA 11.1 as well with the correct torch versions:
pip install torch==1.10.1+cu111 torchvision==0.11.2+cu111 -f https://download.pytorch.org/whl/torch_stable.html torchmetrics==0.2.0 pytorch-lightning==1.3.0rc1
Thanks for the making the fixes to the data folder and to the requirements.txt folder. I gave the notebook run another try and here are the results.
Following the instructions, the notebook now fails on the same demo.py run command with:
INFO - 2022-06-24 04:25:00,958 - utils - NumExpr defaulting to 8 threads.
INFO - 2022-06-24 04:25:01,206 - acceleratesupport - OpenGL_accelerate module loaded
INFO - 2022-06-24 04:25:01,211 - arraydatatype - Using accelerated ArrayDatatype
Traceback (most recent call last):
File "demo.py", line 24, in <module>
from human_shape.models.build import build_model
File "/content/shapy/regressor/human_shape/models/__init__.py", line 1, in <module>
from .build import build_model
File "/content/shapy/regressor/human_shape/models/build.py", line 10, in <module>
from .body_heads import build_body_head, BODY_HEAD_REGISTRY
File "/content/shapy/regressor/human_shape/models/body_heads/__init__.py", line 3, in <module>
from .body_heads import *
File "/content/shapy/regressor/human_shape/models/body_heads/body_heads.py", line 13, in <module>
from ..common.iterative_regressor import HMRLikeRegressor
File "/content/shapy/regressor/human_shape/models/common/iterative_regressor.py", line 37, in <module>
from attributes import A2B, B2A
File "/usr/local/lib/python3.7/dist-packages/shape_attributes-0.2.0-py3.7.egg/attributes/__init__.py", line 1, in <module>
# -*- coding: utf-8 -*-
ModuleNotFoundError: No module named 'attributes.attributes_betas'
I then modified
from .attributes.attributes_betas.a2b import A2B, A2BProbabilistic
to be
from attributes_betas.a2b import A2B, A2BProbabilistic
and then go the new error:
Traceback (most recent call last):
File "demo.py", line 8, in <module>
from attributes.utils.config import parse_args
File "/content/shapy/attributes/attributes/__init__.py", line 1, in <module>
from .attributes_betas.a2b import A2B, A2BProbabilistic
File "/content/shapy/attributes/attributes/attributes_betas/a2b.py", line 16, in <module>
import pytorch_lightning as pl
File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/__init__.py", line 28, in <module>
from pytorch_lightning import metrics # noqa: E402
File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/metrics/__init__.py", line 15, in <module>
from pytorch_lightning.metrics.classification import ( # noqa: F401
File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/metrics/classification/__init__.py", line 14, in <module>
from pytorch_lightning.metrics.classification.accuracy import Accuracy # noqa: F401
File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/metrics/classification/accuracy.py", line 18, in <module>
from pytorch_lightning.metrics.utils import deprecated_metrics
File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/metrics/utils.py", line 29, in <module>
from pytorch_lightning.utilities import rank_zero_deprecation
File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/utilities/__init__.py", line 18, in <module>
from pytorch_lightning.utilities.apply_func import move_data_to_device # noqa: F401
File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/utilities/apply_func.py", line 28, in <module>
if _compare_version("torchtext", operator.ge, "0.9.0"):
File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/utilities/imports.py", line 53, in _compare_version
pkg = importlib.import_module(package)
File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/usr/local/lib/python3.7/dist-packages/torchtext/__init__.py", line 7, in <module>
from . import datasets
File "/usr/local/lib/python3.7/dist-packages/torchtext/datasets/__init__.py", line 3, in <module>
from .ag_news import AG_NEWS
File "/usr/local/lib/python3.7/dist-packages/torchtext/datasets/ag_news.py", line 5, in <module>
from torchtext.data.datasets_utils import (
File "/usr/local/lib/python3.7/dist-packages/torchtext/data/datasets_utils.py", line 11, in <module>
from torch.utils.data import functional_datapipe, IterDataPipe
ImportError: cannot import name 'functional_datapipe' from 'torch.utils.data' (/usr/local/lib/python3.7/dist-packages/torch/utils/data/__init__.py)
I checked the torch version and it was
import torch
torch.__version__
>>> 1.7.1
which is the correct version that requirements.txt specifies. Do you have a working docker image to share? Happy to take a look and dive deeper to resolve this issues if so.
I tested the installation on my local machine and it worked perfectly fine. Since in colab, the CUDA and python versions are different from the ones I tested, you might need to change some package versions to resolve the 'functional_datapipe' import error.
Instead of changing the imports manually, better use export PYTHONPATH=$PYTHONPATH:$(pwd)/attributes/
.
Can you try it on your local machine with the tested CUDA and python versions? Below is the install command, just replace [YOUR-CUDA-10.2-FOLDER] with your local cuda installation. If that doesn't work I am happy to work on a docker image.
git clone git@github.com:muelea/shapy.git
cd shapy
export PYTHONPATH=$PYTHONPATH:$(pwd)/attributes/
export CUDA_HOME=[YOUR-CUDA-10.2-FOLDER]
python3.8 -m venv .venv/shapy
source .venv/shapy/bin/activate
pip install -r requirements.txt
cd attributes
python setup.py install
cd ../mesh-mesh-intersection
export CUDA_SAMPLES_INC=$(pwd)/include
pip install -r requirements.txt
python setup.py install
Hey
Thanks for the making the fixes to the data folder and to the requirements.txt folder. I gave the notebook run another try and here are the results.
Following the instructions, the notebook now fails on the same demo.py run command with:
INFO - 2022-06-24 04:25:00,958 - utils - NumExpr defaulting to 8 threads. INFO - 2022-06-24 04:25:01,206 - acceleratesupport - OpenGL_accelerate module loaded INFO - 2022-06-24 04:25:01,211 - arraydatatype - Using accelerated ArrayDatatype Traceback (most recent call last): File "demo.py", line 24, in <module> from human_shape.models.build import build_model File "/content/shapy/regressor/human_shape/models/__init__.py", line 1, in <module> from .build import build_model File "/content/shapy/regressor/human_shape/models/build.py", line 10, in <module> from .body_heads import build_body_head, BODY_HEAD_REGISTRY File "/content/shapy/regressor/human_shape/models/body_heads/__init__.py", line 3, in <module> from .body_heads import * File "/content/shapy/regressor/human_shape/models/body_heads/body_heads.py", line 13, in <module> from ..common.iterative_regressor import HMRLikeRegressor File "/content/shapy/regressor/human_shape/models/common/iterative_regressor.py", line 37, in <module> from attributes import A2B, B2A File "/usr/local/lib/python3.7/dist-packages/shape_attributes-0.2.0-py3.7.egg/attributes/__init__.py", line 1, in <module> # -*- coding: utf-8 -*- ModuleNotFoundError: No module named 'attributes.attributes_betas'
I then modified
from .attributes.attributes_betas.a2b import A2B, A2BProbabilistic
to be
from attributes_betas.a2b import A2B, A2BProbabilistic
and then go the new error:
Traceback (most recent call last): File "demo.py", line 8, in <module> from attributes.utils.config import parse_args File "/content/shapy/attributes/attributes/__init__.py", line 1, in <module> from .attributes_betas.a2b import A2B, A2BProbabilistic File "/content/shapy/attributes/attributes/attributes_betas/a2b.py", line 16, in <module> import pytorch_lightning as pl File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/__init__.py", line 28, in <module> from pytorch_lightning import metrics # noqa: E402 File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/metrics/__init__.py", line 15, in <module> from pytorch_lightning.metrics.classification import ( # noqa: F401 File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/metrics/classification/__init__.py", line 14, in <module> from pytorch_lightning.metrics.classification.accuracy import Accuracy # noqa: F401 File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/metrics/classification/accuracy.py", line 18, in <module> from pytorch_lightning.metrics.utils import deprecated_metrics File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/metrics/utils.py", line 29, in <module> from pytorch_lightning.utilities import rank_zero_deprecation File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/utilities/__init__.py", line 18, in <module> from pytorch_lightning.utilities.apply_func import move_data_to_device # noqa: F401 File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/utilities/apply_func.py", line 28, in <module> if _compare_version("torchtext", operator.ge, "0.9.0"): File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/utilities/imports.py", line 53, in _compare_version pkg = importlib.import_module(package) File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "/usr/local/lib/python3.7/dist-packages/torchtext/__init__.py", line 7, in <module> from . import datasets File "/usr/local/lib/python3.7/dist-packages/torchtext/datasets/__init__.py", line 3, in <module> from .ag_news import AG_NEWS File "/usr/local/lib/python3.7/dist-packages/torchtext/datasets/ag_news.py", line 5, in <module> from torchtext.data.datasets_utils import ( File "/usr/local/lib/python3.7/dist-packages/torchtext/data/datasets_utils.py", line 11, in <module> from torch.utils.data import functional_datapipe, IterDataPipe ImportError: cannot import name 'functional_datapipe' from 'torch.utils.data' (/usr/local/lib/python3.7/dist-packages/torch/utils/data/__init__.py)
I checked the torch version and it was
import torch torch.__version__ >>> 1.7.1
which is the correct version that requirements.txt specifies. Do you have a working docker image to share? Happy to take a look and dive deeper to resolve this issues if so.
Hey Nicholas,
Where you able to successfully run it on google collab?
Can you provide a colab notebook with a proper setup?
I tried but was unable to get it working.
A few issues:
shapy/data/download_data.sh
as instructed in INSTALL.md fails b/c there is no data folder, and hence no download_data.sh. I tried using wget directly by runningwget --post-data "username=$username&password=$password" 'https://download.is.tue.mpg.de/download.php?domain=shapy&sfile=shapy_data.zip' -O './shapy_data.zip' --no-check-certificate --continue
but that did not work either.I was able to fix the pip issues by relaxing the versions of Pillow, PyYAML and fvcore, so the pip install succeeded.
But when I run
I get the following error.
I think this indicates a cuda mismatch?
Colab cuda version is V11.1.105:
Here is my notebook: https://colab.research.google.com/drive/15M3KpSCX_pvI5yv40spzvYiLXlDRUXf4?usp=sharing