Closed RainbowCatSzy closed 3 years ago
Hi, could you provide more context? Are you using KvsAll training? A custom model you made? Or are all settings straight from LibKGE? What are those settings? It seems you are using numpy somewhere.
On Tue, 27 Apr 2021, 03:42 RainbowRr, @.***> wrote:
Evaluating on valid data (epoch 5)... Traceback (most recent call last): File "/kge/kge/cli.py", line 285, in main job.run() File "/kge/kge/job/job.py", line 159, in run result = self._run() File "/kge/kge/job/train.py", line 222, in _run trace_entry = self.valid_job.run() File "/kge/kge/job/job.py", line 159, in run result = self._run() File "/kge/kge/job/eval.py", line 67, in _run self._evaluate() File "/.conda/envs/machine/lib/python3.7/site-packages/torch/autograd/grad_mode.py", line 26, in decorate_context return func(*args, *kwargs) File "/kge/kge/job/eval_entity_ranking.py", line 140, in _evaluate for batch_number, batch_coords in enumerate(self.loader): File "/.conda/envs/machine/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in next* data = self._next_data() File "/.conda/envs/machine/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/.conda/envs/machine/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 47, in fetch return self.collate_fn(data) File "/kge/kge/job/eval_entity_ranking.py", line 83, in _collate self.dataset.index(f"{split}_po_to_s"), File "/kge/kge/job/util.py", line 19, in get_sp_po_coords_from_spo_batch sp_coords = sp_index.get_all(batch[:, [0, 1]]) File "/kge/kge/indexing.py", line 151, in get_all self._values.numpy(), self._values_offset.numpy() TypeError: expected dtype object, got 'numpy.dtype[int32]'
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/uma-pi1/kge/issues/198, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABEWXZAEMUO3B2I7DRI7CG3TKYJBHANCNFSM43UAONTQ .
This could probably occur due to our update in the filtering in evaluation. There we introduced numba and therefore convert to numpy first. Could you please share your configuration file, so we can debug this.
Getting the same error message on running the toy example (following the readme file)
kge start examples/toy-complex-train.yaml --job.device cpu
Does the issue still arise if you first delete all *.pckl
files under data/toy
?
Yes, tried again after removing all *.pckl
file, getting the same error. (btw the traceback is same)
I can not reporduce this bug. Are you using Linux or Windows?
Are you using the dependency versions specified in the setup? In particular numba==0.50.*
?
I can not reporduce this bug. Are you using Linux or Windows? Are you using the dependency versions specified in the setup? In particular
numba==0.50.*
?
hi, I am using the complex.yaml and distmult.yaml for fb15k dataset provided in read me
I can not reporduce this bug. Are you using Linux or Windows? Are you using the dependency versions specified in the setup? In particular
numba==0.50.*
?
I am using Ubuntu, python 3.7.5
with numba-0.50.1
. That said, I will re-download the repo and try again. Will report back.
Just to make sure, I also reinstalled. Works all fine for me. ONly thing different is that I have python 3.8.5
installed. Can you try if upgrading to python 3.8 helps.
Perhaps related to https://github.com/numba/numba/issues/6041
This bug seems to occur with numpy 1.20. Which version of numpy do you use? If that's the issue, we may want to constrain the numpy version as well fo rnow (I am using 1.19.1).
I ran into the same problem when training ComplEx on a custom dataset. Downgrading to numpy=1.19.1 fixed the problem for me!
Thanks @MatthewGleeson!
@AdrianKs It's probably best if we upgrade LibKGE's numba version instead of forcing a downgrade of numpy.
upgraded to newest numba version (0.53.1) in 53303ca . everything seems to work with the new version.
Evaluating on valid data (epoch 5)... Traceback (most recent call last): File "/kge/kge/cli.py", line 285, in main job.run() File "/kge/kge/job/job.py", line 159, in run result = self._run() File "/kge/kge/job/train.py", line 222, in _run trace_entry = self.valid_job.run() File "/kge/kge/job/job.py", line 159, in run result = self._run() File "/kge/kge/job/eval.py", line 67, in _run self._evaluate() File "/.conda/envs/machine/lib/python3.7/site-packages/torch/autograd/grad_mode.py", line 26, in decorate_context return func(*args, **kwargs) File "/kge/kge/job/eval_entity_ranking.py", line 140, in _evaluate for batch_number, batch_coords in enumerate(self.loader): File "/.conda/envs/machine/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in next data = self._next_data() File "/.conda/envs/machine/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/.conda/envs/machine/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 47, in fetch return self.collate_fn(data) File "/kge/kge/job/eval_entity_ranking.py", line 83, in _collate self.dataset.index(f"{split}_po_to_s"), File "/kge/kge/job/util.py", line 19, in get_sp_po_coords_from_spo_batch sp_coords = sp_index.get_all(batch[:, [0, 1]]) File "/kge/kge/indexing.py", line 151, in get_all self._values.numpy(), self._values_offset.numpy() TypeError: expected dtype object, got 'numpy.dtype[int32]'