thunlp / OpenKE

An Open-Source Package for Knowledge Embedding (KE)
3.83k stars 985 forks source link

OSError: exception: access violation writing 0x000002061CDEC048 #299

Closed jackchenwen closed 3 years ago

jackchenwen commented 3 years ago

D:\anaconda3\envs\pytorch\python.exe E:/pycharmProjects/OpenKE-OpenKE-PyTorch/examples/train_transe_WN18_adv_sigmoidloss.py Traceback (most recent call last): File "E:/pycharmProjects/OpenKE-OpenKE-PyTorch/examples/train_transe_WN18_adv_sigmoidloss.py", line 17, in neg_rel = 0 File "E:\pycharmProjects\OpenKE-OpenKE-PyTorch\openke\data\TrainDataLoader.py", line 75, in init self.read() File "E:\pycharmProjects\OpenKE-OpenKE-PyTorch\openke\data\TrainDataLoader.py", line 88, in read self.lib.importTrainFiles() OSError: exception: access violation writing 0x000002061CDEC048 Input Files Path : ./benchmarks/WN18RR/ The toolkit is importing datasets. The total of relations is 0. The total of entities is 0.

Process finished with exit code 1

WenXiuxiu commented 3 years ago

Set the relative path to the absolute paths. TestDataLoader(in_path="XXXX:XXXX/benchmarks/FB15K237/",sampling_mode= "link")

jackchenwen commented 3 years ago

Set the relative path to the absolute paths. TestDataLoader(in_path="XXXX:XXXX/benchmarks/FB15K237/",sampling_mode= "link")

还是报错,是不支持windows平台运行吗?

D:\anaconda3\envs\pytorch\python.exe E:/pycharmProjects/OpenKE-OpenKE-PyTorch/examples/train_transe_WN18_adv_sigmoidloss.py 0%| | 0/3000 [00:00<?, ?it/s]Finish initializing... 0%| | 0/3000 [00:00<?, ?it/s] Traceback (most recent call last): File "E:/pycharmProjects/OpenKE-OpenKE-PyTorch/examples/train_transe_WN18_adv_sigmoidloss.py", line 43, in trainer.run() File "E:\pycharmProjects\OpenKE-OpenKE-PyTorch\openke\config\Trainer.py", line 93, in run loss = self.train_one_step(data) File "E:\pycharmProjects\OpenKE-OpenKE-PyTorch\openke\config\Trainer.py", line 52, in train_one_step loss.backward() File "D:\anaconda3\envs\pytorch\lib\site-packages\torch\tensor.py", line 198, in backward torch.autograd.backward(self, gradient, retain_graph, create_graph) File "D:\anaconda3\envs\pytorch\lib\site-packages\torch\autograd__init__.py", line 100, in backward allow_unreachable=True) # allow_unreachable flag RuntimeError: merge_sort: failed to synchronize: an illegal memory access was encountered Input Files Path : D:/benchmarks/WN18RR/ The toolkit is importing datasets. The total of relations is 11. The total of entities is 40943. The total of train triples is 86835. Input Files Path : D:/benchmarks/WN18RR/ The total of test triples is 3134. The total of valid triples is 3034.

Process finished with exit code 1

WenXiuxiu commented 3 years ago

From the ouputs The total of relations is 11. The total of entities is 40943. The total of train triples is 86835. it seems that you have succsefully loaded the data, and the problem is not in the C++ part. I think the problem is in the python part (may be the version of you pytorch or cuda), you can debug it.

I think you have forget one step"$ cp examples/train_transe_FB15K237.py ./". If this step was done, the the code can run without changing relative paths to absulote paths.

I am sure that this project can run on windows since I am using it on win10.

jackchenwen commented 3 years ago

From the ouputs The total of relations is 11. The total of entities is 40943. The total of train triples is 86835. it seems that you have succsefully loaded the data, and the problem is not in the C++ part. I think the problem is in the python part (may be the version of you pytorch or cuda), you can debug it.

I think you have forget one step"$ cp examples/train_transe_FB15K237.py ./". If this step was done, the the code can run without changing relative paths to absulote paths.

I am sure that this project can run on windows since I am using it on win10.

Thank you very much

nipirennipi commented 3 years ago

如何在window中编译生成Base.dll文件,可以发一份给我吗1546321392@qq.com,orz。

nipirennipi commented 3 years ago

From the ouputs The total of relations is 11. The total of entities is 40943. The total of train triples is 86835. it seems that you have succsefully loaded the data, and the problem is not in the C++ part. I think the problem is in the python part (may be the version of you pytorch or cuda), you can debug it.

I think you have forget one step"$ cp examples/train_transe_FB15K237.py ./". If this step was done, the the code can run without changing relative paths to absulote paths.

I am sure that this project can run on windows since I am using it on win10.

Traceback (most recent call last): File "D:/桌面/OpenKE-OpenKE-PyTorch/examples/train_transe_FB15K237.py", line 17, in neg_rel = 0) File "D:\桌面\OpenKE-OpenKE-PyTorch\openke\data\TrainDataLoader.py", line 43, in init self.lib = ctypes.cdll.LoadLibrary(base_file) File "D:\Anaconda3\envs\pytorch\lib\ctypes__init__.py", line 426, in LoadLibrary return self._dlltype(name) File "D:\Anaconda3\envs\pytorch\lib\ctypes__init.py", line 348, in init__ self._handle = _dlopen(self._name, mode) OSError: [WinError 126] 找不到指定的模块。

How to run it on Windows? I've put Base.dll in directory "OpenKE-OpenKE-PyTorch\openke\release", in the code, the 'os' suffix is changed to 'dll', why is there still an error that the specified module cannot be found? plz plz plz

LiuYuemei111 commented 3 years ago

Since some dependency packages used in the C++ code of pytorch version cannot be compiled on the window, this version does not support the window system. You'd better to use it on linux