Hanjun-Dai / pytorch_structure2vec

pytorch implementation of structure2vec (https://arxiv.org/abs/1603.05629)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AttributeError: type object 'object' has no attribute '__getattr__'

xjtuncy opened this issue · comments

Dear author, I want to know the version of the pytorch you used. I am using torch-0.1.11.post5-cp27-none-linux_x86_64. But when I ran:
python main.py -gm mean_field -saved_model saved/mean_field.model -phase test -mode cpu
Some error occurred, and I think it was caused by different versions of pytorch.

Thanks!

‘’
====== begin of s2v configuration ======
| msg_average = 0
====== end of s2v configuration ======
loading data
train: 1900000
valid: 82601
test: 220289
Traceback (most recent call last):
File "main.py", line 111, in
regressor = Regressor()
File "main.py", line 92, in init
max_lv=cmd_args.max_lv)
File "/home/xjtuncy/lab/pytorch_structure2vecLab/pytorch_structure2vec-master/harvard_cep/../s2v_lib/embedding.py", line 35, in init
weights_init(self)
File "/home/xjtuncy/lab/pytorch_structure2vecLab/pytorch_structure2vec-master/harvard_cep/../s2v_lib/pytorch_util.py", line 46, in weights_init
for name, p in m.named_parameters():
File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 237, in getattr
return object.getattr(self, name)
AttributeError: type object 'object' has no attribute 'getattr'
‘’

Hi there,

I'm using torch-0.3.0.post4. Could you please try this version and let me know if it works.

Now,I'm using torch-0.3.0.post4 and it works.

Thank you very much!