sdc17 / UPop

[ICML 2023] UPop: Unified and Progressive Pruning for Compressing Vision-Language Transformers.
https://dachuanshi.com/UPop-Project/
BSD 3-Clause "New" or "Revised" License
99 stars 5 forks source link

ModuleNotFoundError: No module named 'petrel_client' #35

Open miki0902 opened 1 month ago

miki0902 commented 1 month ago

こんにちは UPopをCLIPで適用しようとすると ModuleNotFoundError: No module named 'petrel_client' のようなエラーが出ます. 自分なりにはclipディレクトリにpetrel_clientディレクトリが無いためエラーが出ていると考えています. ただし,自分はまだ初学者で間違えている可能性もあるので知識のある方にアドバイスと解決策を教えていただきたいです よろしくお願いします 以下に自分のclipディレクトリとエラー文を添付します

Hello. When I try to apply UPop with CLIP, I get ModuleNotFoundError: No module named 'petrel_client' I think the error is because there is no petrel_client directory in the CLIP directory. I think the error is because there is no petrel_client directory in the clip directory. However, I am still a beginner, and there is a possibility that I am wrong, so I would like to get advice and solutions from someone with knowledge. Thank you in advance. I have attached my clip directory and the error text below.

您好。 当我尝试用 CLIP 应用 UPop 时 模块未找到错误:没有名为 “petrel_client ”的模块 我收到类似 “ModuleNotFoundError: No module named ‘petrel_client’”的错误。 我认为这个错误是因为在 clip 目录中没有 petrel_client 目录。 不过,我还是个初学者,可能会出错,所以我希望能从有知识的人那里获得建议和解决方案。 提前感谢您的帮助。 我将剪辑目录和错误文本附在下面。

スクリーンショット 2024-10-17 20 29 24 スクリーンショット 2024-10-17 20 32 21
sdc17 commented 1 month ago

Hi,

You can delete or comment anything related to "petrel" such as: https://github.com/sdc17/UPop/blob/6aae798a9a576cf001ab1ca27b5afc15cbeeda46/clip/clip.py#L16

This is an optional package used to load data. The code will also work without this package.

miki0902 commented 1 month ago

返信ありがとうございます

インポートをコメントした場合、編集するべきコードはありますか 現状NameError: name 'Client' is not definedというエラーが出ています

Thanks for the reply.

Is there any code I should edit if I commented the import I am getting an error that says Current NameError: name 'Client' is not defined

スクリーンショット 2024-10-18 14 12 00
miki0902 commented 1 month ago

こんにちは、Clientに関する箇所を編集したら、別のエラーにたどり着きました ImportError: cannot import name '_scaled_dot_product_attention' from 'torch.nn.functional' と出ており,torchのバージョンが原因であると考えられています 現在私の環境ではversion2.4.1を使用していますが,推奨しているversionはありますか

Hi, I edited the part about Client and got to another error ImportError: cannot import name '_scaled_dot_product_attention' from 'torch.nn.functional' and I believe it is due to the version of torch I am currently using version 2.4.1. Is there a recommended version?

`***** Setting OMP_NUM_THREADS environment variable for each process to be 1 in default, to avoid your system being overloaded, please further tune the variable for optimal performance in your application as needed.


/root/miniconda3/envs/upop/lib/python3.8/site-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension: libtorch_cuda_cu.so: cannot open shared object file: No such file or directory warn(f"Failed to load image Python extension: {e}") /root/miniconda3/envs/upop/lib/python3.8/site-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension: libtorch_cuda_cu.so: cannot open shared object file: No such file or directory warn(f"Failed to load image Python extension: {e}") Traceback (most recent call last): File "compress_retrieval_clip.py", line 24, in from clip import clip File "/home/miki/UPop-main-4/clip/init.py", line 2, in from . import mock File "/home/miki/UPop-main-4/clip/mock.py", line 2, in from torch.nn.functional import ( ImportError: cannot import name '_scaled_dot_product_attention' from 'torch.nn.functional' (/root/miniconda3/envs/upop/lib/python3.8/site-packages/torch/nn/functional.py) Traceback (most recent call last): File "compress_retrieval_clip.py", line 24, in from clip import clip File "/home/miki/UPop-main-4/clip/init.py", line 2, in from . import mock File "/home/miki/UPop-main-4/clip/mock.py", line 2, in from torch.nn.functional import ( ImportError: cannot import name '_scaled_dot_product_attention' from 'torch.nn.functional' (/root/miniconda3/envs/upop/lib/python3.8/site-packages/torch/nn/functional.py) W1018 06:55:01.805221 140239165204288 torch/distributed/elastic/multiprocessing/api.py:858] Sending process 642105 closing signal SIGTERM E1018 06:55:01.970727 140239165204288 torch/distributed/elastic/multiprocessing/api.py:833] failed (exitcode: 1) local_rank: 0 (pid: 642104) of binary: /root/miniconda3/envs/upop/bin/python3 Traceback (most recent call last): File "/root/miniconda3/envs/upop/lib/python3.8/runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "/root/miniconda3/envs/upop/lib/python3.8/runpy.py", line 87, in _run_code exec(code, run_globals) File "/root/miniconda3/envs/upop/lib/python3.8/site-packages/torch/distributed/run.py", line 905, in main() File "/root/miniconda3/envs/upop/lib/python3.8/site-packages/torch/distributed/elastic/multiprocessing/errors/init.py", line 348, in wrapper return f(*args, **kwargs) File "/root/miniconda3/envs/upop/lib/python3.8/site-packages/torch/distributed/run.py", line 901, in main run(args) File "/root/miniconda3/envs/upop/lib/python3.8/site-packages/torch/distributed/run.py", line 892, in run elastic_launch( File "/root/miniconda3/envs/upop/lib/python3.8/site-packages/torch/distributed/launcher/api.py", line 133, in call return launch_agent(self._config, self._entrypoint, list(args)) File "/root/miniconda3/envs/upop/lib/python3.8/site-packages/torch/distributed/launcher/api.py", line 264, in launch_agent raise ChildFailedError( torch.distributed.elastic.multiprocessing.errors.ChildFailedError: `

sdc17 commented 1 month ago

Hi,

Torch 1.x is recommended.

https://github.com/sdc17/UPop/blob/6aae798a9a576cf001ab1ca27b5afc15cbeeda46/README.md?plain=1#L76

miki0902 commented 1 month ago

Thank you. I was able to move it safely !