INK-USC / RE-Net

Recurrent Event Network: Autoregressive Structure Inference over Temporal Knowledge Graphs (EMNLP 2020)
http://inklab.usc.edu/renet/
436 stars 95 forks source link

AttributeError in pretrain.py #25

Closed boldchan closed 4 years ago

boldchan commented 4 years ago

torch.version 1.4.0 dgl-cu100.version 0.4.2

when run

python3 pretrain.py -d DATA_NAME --gpu 0 --dropout 0.5 --n-hidden 200 --lr 1e-3 --max-epochs 20 --batch-size 1024

as in README:

Traceback (most recent call last): File "pretrain.py", line 139, in train(args) File "pretrain.py", line 104, in train 's_hist': model.s_hist_test, 's_cache': model.s_hiscache, File "/DIRECTORY/TO/RE-Net/venv/lib/python3.6/site-packages/torch/nn/modules/module.py", line 576, in __getattr_\ type(self).name, name)) AttributeError: 'RENet_global' object has no attribute 's_hist_test'

https://github.com/INK-USC/RE-Net/blob/9923608cfc57b789d7c77b00a04b51675a74c1fa/pretrain.py#L103-L107

woojeongjin commented 4 years ago

Hi, thanks for your interest. You should specify the model number. But I have edited the code. It will work now.