zjunlp / MKG_Analogy

[ICLR 2023] Multimodal Analogical Reasoning over Knowledge Graphs
https://zjunlp.github.io/project/MKG_Analogy/
MIT License
99 stars 11 forks source link

environment problem #7

Closed lcclccc closed 1 year ago

lcclccc commented 1 year ago

老师您好 就是我在用您这个代码的时候,显示OSError: [WinError 193] %1 不是有效的 Win32 应用程序。错误,在网上查询后发现是虚拟环境要是32位,但是创建32位的虚拟环境后无法安装torch包。想请问您一下这个代码的环境应该是什么样的?

flow3rdown commented 1 year ago

您好,我们是在linux上进行的实验,您可以贴一下详细的报错信息吗

lcclccc commented 1 year ago

我是在windows上面进行的实验,这个实验可以在windows上面进行吗

flow3rdown commented 1 year ago

可以在windows上进行,需要把依赖包都装好。您可以看下这个https://zhuanlan.zhihu.com/p/364948060 能不能解决的您的问题。

lcclccc commented 1 year ago

您好 我在解决以上问题后 我在运行bash scripts/run_pretrain_mkgformer.sh时 又出现了 IndexError: index 3494 is out of bounds for dimension 0 with size 2 问题
以下是整个报错 Validation sanity check: 0%| | 0/2 [00:00<?, ?it/s]Traceback (most recent call last): File "main.py", line 167, in main() File "main.py", line 156, in main trainer.fit(lit_model, datamodule=data) File "/root/miniconda3/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 458, in fit self._run(model) File "/root/miniconda3/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 756, in _run self.dispatch() File "/root/miniconda3/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 797, in dispatch self.accelerator.start_training(self) File "/root/miniconda3/lib/python3.8/site-packages/pytorch_lightning/accelerators/accelerator.py", line 96, in start_training self.training_type_plugin.start_training(trainer) File "/root/miniconda3/lib/python3.8/site-packages/pytorch_lightning/plugins/training_type/training_type_plugin.py", line 144, in start_training self._results = trainer.run_stage() File "/root/miniconda3/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 807, in run_stage return self.run_train() File "/root/miniconda3/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 842, in run_train self.run_sanity_check(self.lightning_module) File "/root/miniconda3/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 1107, in run_sanity_check self.run_evaluation() File "/root/miniconda3/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 949, in run_evaluation for batch_idx, batch in enumerate(dataloader): File "/root/miniconda3/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 633, in next data = self._next_data() File "/root/miniconda3/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1345, in _next_data return self._process_data(data) File "/root/miniconda3/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1371, in _process_data data.reraise() File "/root/miniconda3/lib/python3.8/site-packages/torch/_utils.py", line 644, in reraise raise exception IndexError: Caught IndexError in DataLoader worker process 0. Original Traceback (most recent call last): File "/root/miniconda3/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 308, in _worker_loop data = fetcher.fetch(index) File "/root/miniconda3/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 54, in fetch return self.collate_fn(data) File "/root/autodl-tmp/MKG/MarT/data/data_module.py", line 139, in call pixel_image.append(entity2visual_features[entities.index(entity)]) IndexError: index 3494 is out of bounds for dimension 0 with size 2

flow3rdown commented 1 year ago

您好,请问您是否提前提取了图片特征?如果没提取需要运行以下命令

cd MarT
python tools/encode_images_data.py
lcclccc commented 1 year ago

已经提取过了 仍然还是出现了以上问题

zxlzr commented 1 year ago

您好,请您检查下python包的版本,这可能是某个python包版本不太对。

flow3rdown commented 1 year ago

已经提取过了 仍然还是出现了以上问题

您好,请您检查下python包的版本,这可能是某个python包版本不太对。

除此之外,也请您检查下entity2visual_features的维度是否正确以及dataset/MarKG中的entity2text.txtentity2textlong.txt等文件是否完整

lcclccc commented 1 year ago

您好 我已经检查了python所有的版本 以及dataset中所有文件完整性 仍然没有解决该问题

zxlzr commented 1 year ago

您好,您可以试试重新安装anaconda虚拟环境和python 依赖环境再试试,感觉是某个包版本不对(可能使用了系统自带版本之类)

flow3rdown commented 1 year ago

您好 我已经检查了python所有的版本 以及dataset中所有文件完整性 仍然没有解决该问题

请问您的entity2visual_features维度是多少?在哪个entity报的错呀?

zxlzr commented 1 year ago

您好您的问题解决了吗