Closed BoccheseGiacomo closed 1 year ago
Is this from executing import videogpt
or something similar? What versions are your packages (e.g. torch, pytorch-lightning, torchmetrics
)? It might also help to paste the full error log you're getting
during the execution of these two lines:
!conda install --yes -c pytorch pytorch=1.7.1 torchvision cudatoolkit=11.0
!pip install git+https://github.com/wilson1yan/VideoGPT.git
i don't get any error but only the following warning: WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv class="ansi-yellow-fg">
then , i get the error executing the line:
from videogpt import load_vqvae
i get the error:
ImportError Traceback (most recent call last)
/tmp/ipykernel_17/323323888.py in
/opt/conda/lib/python3.7/site-packages/videogpt/init.py in
/opt/conda/lib/python3.7/site-packages/videogpt/vqvae.py in
/opt/conda/lib/python3.7/site-packages/pytorch_lightning/init.py in
/opt/conda/lib/python3.7/site-packages/pytorch_lightning/metrics/init.py in
/opt/conda/lib/python3.7/site-packages/pytorch_lightning/metrics/classification/init.py in
/opt/conda/lib/python3.7/site-packages/pytorch_lightning/metrics/classification/accuracy.py in
/opt/conda/lib/python3.7/site-packages/pytorch_lightning/metrics/utils.py in
ImportError: cannot import name 'get_num_classes' from 'torchmetrics.utilities.data' (/opt/conda/lib/python3.7/site-packages/torchmetrics/utilities/data.py)
hope this can help understanding the problem. now i check the versions
torch==1.7.1+cu110 torchaudio==0.7.2 torchmetrics==0.9.3 torchtext==0.8.1 torchvision==0.8.2+cu110 pytorch-ignite==0.4.9 pytorch-lightning==1.3.3
jaxlib==0.3.15+cuda11.cudnn805
Okay, it seems to work for me with torchmetrics==0.3.2
. Perhaps try that version?
now i've tried it, and i get other errors: in the download of the packages: *ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. pytorch-lightning 1.7.2 requires torch>=1.9., but you have torch 1.7.1+cu110 which is incompatible. fairscale 0.4.6 requires torch>=1.8.0, but you have torch 1.7.1+cu110 which is incompatible. allennlp 2.10.0 requires protobuf==3.20.0, but you have protobuf 3.19.4 which is incompatible. allennlp 2.10.0 requires torch<1.12.0,>=1.10.0, but you have torch 1.7.1+cu110 which is incompatible. Successfully installed torch-1.7.1+cu110 torchaudio-0.7.2 torchvision-0.8.2+cu110 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with t**
*ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. pytorch-lightning 1.7.2 requires torch>=1.9., but you have torch 1.7.1+cu110 which is incompatible. pytorch-lightning 1.7.2 requires torchmetrics>=0.7.0, but you have torchmetrics 0.3.2 which is incompatible.**
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. dask-cudf 21.10.1 requires cupy-cuda114, which is not installed. pandas-profiling 3.1.0 requires markupsafe~=2.0.1, but you have markupsafe 2.1.1 which is incompatible. gcsfs 2022.5.0 requires fsspec==2022.5.0, but you have fsspec 2022.7.1 which is incompatible. flax 0.6.0 requires rich~=11.1, but you have rich 12.1.0 which is incompatible. dask-cudf 21.10.1 requires dask==2021.09.1, but you have dask 2022.2.0 which is incompatible. dask-cudf 21.10.1 requires distributed==2021.09.1, but you have distributed 2022.2.0 which is incompatible. allennlp 2.10.0 requires protobuf==3.20.0, but you have protobuf 3.19.4 which is incompatible. allennlp 2.10.0 requires torch<1.12.0,>=1.10.0, but you have torch 1.7.1+cu110 which is incompatible.
but it tried to install the packages and it managed to do it.
Then , during the run of:
from videogpt import load_vqvae
i get the error:
**ModuleNotFoundError Traceback (most recent call last)
/tmp/ipykernel_18/323323888.py in
/opt/conda/lib/python3.7/site-packages/videogpt/init.py in
/opt/conda/lib/python3.7/site-packages/videogpt/vqvae.py in
/opt/conda/lib/python3.7/site-packages/pytorch_lightning/init.py in
/opt/conda/lib/python3.7/site-packages/pytorch_lightning/callbacks/init.py in
/opt/conda/lib/python3.7/site-packages/pytorch_lightning/callbacks/stochastic_weight_avg.py in
/opt/conda/lib/python3.7/site-packages/pytorch_lightning/trainer/init.py in
/opt/conda/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py in
/opt/conda/lib/python3.7/site-packages/pytorch_lightning/accelerators/init.py in
/opt/conda/lib/python3.7/site-packages/pytorch_lightning/accelerators/accelerator.py in
/opt/conda/lib/python3.7/site-packages/pytorch_lightning/plugins/init.py in
/opt/conda/lib/python3.7/site-packages/pytorch_lightning/plugins/plugins_registry.py in
/opt/conda/lib/python3.7/site-packages/pytorch_lightning/plugins/training_type/init.py in
/opt/conda/lib/python3.7/site-packages/pytorch_lightning/plugins/training_type/sharded_spawn.py in
/opt/conda/lib/python3.7/site-packages/pytorch_lightning/plugins/precision/init.py in
/opt/conda/lib/python3.7/site-packages/pytorch_lightning/plugins/precision/sharded_native_amp.py in
/opt/conda/lib/python3.7/site-packages/fairscale/optim/grad_scaler.py in
ModuleNotFoundError: No module named 'torch.cuda.amp.common'**.
thank you.
ok . running it in colab instead of kaggle with the specific verion of torchmetrics works for the import part and loading the model. now i get an assertion error in the part of "cropping the video":
video = preprocess(video, resolution, sequence_length).unsqueeze(0).to(device)
AssertionError Traceback (most recent call last)
/usr/local/lib/python3.7/dist-packages/videogpt/data.py in preprocess(video, resolution, sequence_length) 83 # temporal crop 84 if sequence_length is not None: ---> 85 assert sequence_length <= t 86 video = video[:sequence_length] 87
AssertionError:
i'm making steps ahead :)
ok. now i was able to make it work. thank you really!
Okay, it seems to work for me with
torchmetrics==0.3.2
. Perhaps try that version?
Hi, I encountered the same problem when import pytorch_lightning and successfully solved it by 'pip install torchmetrics==0.3.2'. However, importing pytorch_lightning takes a long time, maybe about several minustes. Do you have some idea what is the problem?
when i try to import the packages, i get this error:
ImportError: cannot import name 'get_num_classes' from 'torchmetrics.utilities.data' (/opt/conda/lib/python3.7/site-packages/torchmetrics/utilities/data.py)
i'm running the program on the kaggle laboratory. can anyone help me? thanks