pliang279 / HighMMT

[TMLR 2022] High-Modality Multimodal Transformer
MIT License
107 stars 7 forks source link

running Python private_test_stcripts/perceivers/roboticsTask. py model. pt #3

Closed Gust-simon closed 1 month ago

Gust-simon commented 2 months ago

Hello, I have already based on https://github.com/fac2003/perceiver-multi-modality-pytorch Installed perceiver-multi-modality-pytorch and perceiver_pytorch, but when running Python private_test_stcripts/perceivers/roboticsTask. py model. pt

Still reporting error: Traceback (most recent call last):

File "private_test_scripts/perceivers/roboticstasks.py", line 6, in

from private_test_scripts.perceivers.crossattnperceiver import MultiModalityPerceiver, InputModality

File "/root/private_test_scripts/perceivers/crossattnperceiver.py", line 11, in

from perceiver_pytorch.perceiver_pytorch import PreNorm, Attention, FeedForward, cache_fn, fourier_encode, \

ImportError: cannot import name 'FeedForwardGELU' from 'perceiver_pytorch.perceiver_pytorch' (/root/anaconda3/envs/jtsaw/lib/python3.8/site-packages/perceiver_pytorch/perceiver_pytorch.py)

May I ask what the reason is?

Gust-simon commented 2 months ago

00

001

lvyiwei1 commented 2 months ago

That is very strange. The class is defined in the multimodal perceiver pytorch repository (line 78 on https://github.com/fac2003/perceiver-multi-modality-pytorch/blob/main/perceiver_pytorch/perceiver_pytorch.py). Can you double check if you have installed/imported the repository into your python environment correctly? Based on the red lines showing in your IDE, it seems like your python environment still defaults to using the lucidrain perceiver.

Gust-simon commented 2 months ago

Yes, I am certain that perceiver_pytorch and perceiver-miulti-mdality-pytorch have been installed in the virtual environment jtsaw that I am currently unsure of the cause of the error 00

lvyiwei1 commented 1 month ago

Can you try uninstalling the lucidrain perceiver-pytorch? This will force the python to use the perceiver_pytorch module from fac2003's repo

Gust-simon commented 1 month ago

After uninstalling on the virtual environment and reinstalling, I still couldn't solve the problem. However, according to the picture that says' Would not remove (might be manually added) ', does it mean that these modules are not included in perceiver_pytorch 00 Then when I uninstalled the preceiver_pytorch and tried to run it again, I reported an error Traceback (most recent call last):  File "private_test_scripts/perceivers/roboticstasks.py", line 6, in     from private_test_scripts.perceivers.crossattnperceiver import MultiModalityPerceiver, InputModality  File "/root/private_test_scripts/perceivers/crossattnperceiver.py", line 11, in     from perceiver_pytorch.perceiver_pytorch import PreNorm, Attention, FeedForward, cache_fn, fourier_encode, \ModuleNotFoundError: No module named 'perceiver_pytorch.perceiver_pytorch'I'm wondering if it's due to receiver multi modality pytorch

lvyiwei1 commented 1 month ago

I think there are probably some mixed-up files when you try to install both perceiver-pytorch repos. Can you try with a new environment where you only install the fac2003 perceiver-pytorch, without installing lucidrain's perceiver-pytorch?

Gust-simon commented 1 month ago

Hello, I have been resolving this issue for the past few days, but I have encountered a new problem where running Python private_test_stcripts/perceivers/roboticstasks.comy model.pt reports an error: Output will be model.pt [fannypack-drive] Downloading file to datasets/gentle_push/cache/1JTgmq1KPRK9HYi8BgvljKg5MPqT_N4cR-gentle_push_1000.hdf5 Traceback (most recent call last): File "/root/anaconda3/envs/jtsaw/lib/python3.8/site-packages/urllib3/connection.py", line 159, in _new_conn conn = connection.create_connection( File "/root/anaconda3/envs/jtsaw/lib/python3.8/site-packages/urllib3/util/connection.py", line 84, in create_connection raise err File "/root/anaconda3/envs/jtsaw/lib/python3.8/site-packages/urllib3/util/connection.py", line 74, in create_connection sock.connect(sa) OSError: [Errno 101] Network is unreachable

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/root/anaconda3/envs/jtsaw/lib/python3.8/site-packages/urllib3/connectionpool.py", line 670, in urlopen httplib_response = self._make_request( File "/root/anaconda3/envs/jtsaw/lib/python3.8/site-packages/urllib3/connectionpool.py", line 381, in _make_request self._validate_conn(conn) File "/root/anaconda3/envs/jtsaw/lib/python3.8/site-packages/urllib3/connectionpool.py", line 976, in _validate_conn conn.connect() File "/root/anaconda3/envs/jtsaw/lib/python3.8/site-packages/urllib3/connection.py", line 308, in connect conn = self._new_conn() File "/root/anaconda3/envs/jtsaw/lib/python3.8/site-packages/urllib3/connection.py", line 171, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7f13fe518b50>: Failed to establish a new connection: [Errno 101] Network is unreachable

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/root/anaconda3/envs/jtsaw/lib/python3.8/site-packages/requests/adapters.py", line 439, in send resp = conn.urlopen( File "/root/anaconda3/envs/jtsaw/lib/python3.8/site-packages/urllib3/connectionpool.py", line 724, in urlopen retries = retries.increment( File "/root/anaconda3/envs/jtsaw/lib/python3.8/site-packages/urllib3/util/retry.py", line 439, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='docs.google.com', port=443): Max retries exceeded with url: /uc?export=download&id=1JTgmq1KPRK9HYi8BgvljKg5MPqT_N4cR (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f13fe518b50>: Failed to establish a new connection: [Errno 101] Network is unreachable'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "private_test_scripts/perceivers/roboticstasks.py", line 25, in trains3, valid3, test3 = PushTask.get_dataloader(16, batch_size=18, drop_last=True, test_multimodal_only=True, test_noises=[0]) File "/tmp/pycharm_project_217/HighMMT-main/datasets/gentle_push/data_loader.py", line 84, in get_dataloader train_trajectories = cls.get_train_trajectories(dataset_args) File "/tmp/pycharm_project_217/HighMMT-main/datasets/gentle_push/data_loader.py", line 134, in get_train_trajectories return _load_trajectories("gentle_push_1000.hdf5", dataset_args) File "/tmp/pycharm_project_217/HighMMT-main/datasets/gentle_push/data_loader.py", line 248, in _load_trajectories fannypack.data.cached_drive_file(name, dataset_urls[name]) File "/root/.local/lib/python3.8/site-packages/fannypack/data/_drive_files.py", line 44, in cached_drive_file download_drive_file(url, cached_filepath) File "/root/.local/lib/python3.8/site-packages/fannypack/data/_drive_files.py", line 76, in download_drive_file response = session.get( File "/root/anaconda3/envs/jtsaw/lib/python3.8/site-packages/requests/sessions.py", line 543, in get return self.request('GET', url, kwargs) File "/root/anaconda3/envs/jtsaw/lib/python3.8/site-packages/requests/sessions.py", line 530, in request resp = self.send(prep, send_kwargs) File "/root/anaconda3/envs/jtsaw/lib/python3.8/site-packages/requests/sessions.py", line 643, in send r = adapter.send(request, **kwargs) File "/root/anaconda3/envs/jtsaw/lib/python3.8/site-packages/requests/adapters.py", line 516, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPSConnectionPool(host='docs.google.com', port=443): Max retries exceeded with url: /uc?export=download&id=1JTgmq1KPRK9HYi8BgvljKg5MPqT_N4cR (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f13fe518b50>: Failed to establish a new connection: [Errno 101] Network is unreachable')) May I ask if you need to log in to Google yourself to crawl data?

lvyiwei1 commented 1 month ago

No, I don't think you need to sign in to download the file. This error only occurs when there is some network connection issues. Can you access https://drive.google.com/file/d/1JTgmq1KPRK9HYi8BgvljKg5MPqT_N4cR/view?usp=sharing from your computer? You can manually download it if the python script continue to error out.