snap-stanford/GraphRNN

Unable to run the test program

purohitsumit opened this issue · 3 comments

Hi @JiaxuanYou ,
I tried to run this code but got following error:
python main.py Traceback (most recent call last): ........... from utils import * File "/XXXX/GraphGeneration/GraphRNN/utils.py", line 13, in <module> import community ImportError: No module named community

I solved this using following commands:
pip install --upgrade --force-reinstall python-louvain
and
pip install community
I suggest to add community module to the requirement file.

But even after this fix, i am unable to run the program. i get following error:
........ File "XXX/GraphGeneration/GraphRNN/model.py", line 988 prob = x_prev @ x_last.permute(0,2,1) ^ SyntaxError: invalid syntax

Do you have any suggestion to fix this error ? i am using Mac 10.12.6 and Python 2.7.13 :: Anaconda custom (x86_64)

Thanks
Sumit

Thanks for the pointer. That error is fixed using python3.
Next i get an error related to CUDA.FloatTensor
On my Mac i have set
export NO_CUDA=1
but i still get following error.

python3 main.py 
/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/importlib/_bootstrap.py:222: RuntimeWarning: compiletime version 3.6 of module 'tensorflow.python.framework.fast_tensor_util' does not match runtime version 3.5
  return f(*args, **kwds)
CUDA 1
File name prefix GraphRNN_RNN_grid_4_128_
graph_validate_len 199.5
graph_test_len 215.0
total graph num: 100, training set: 80
max number node: 361
max/min number edge: 684; 180
max previous node: 40
train and test graphs saved at:  ./graphs/GraphRNN_RNN_grid_4_128_test_0.dat
/XXXX/GraphGeneration/GraphRNN/model.py:299: UserWarning: nn.init.xavier_uniform is now deprecated in favor of nn.init.xavier_uniform_.
  nn.init.xavier_uniform(param,gain=nn.init.calculate_gain('sigmoid'))
..........
  File "main.py", line 128, in <module>
    has_output=True, output_size=args.hidden_size_rnn_output).cuda()
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/torch/nn/modules/module.py", line 249, in cuda
    return self._apply(lambda t: t.cuda(device))
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/torch/nn/modules/module.py", line 176, in _apply
    module._apply(fn)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/torch/nn/modules/module.py", line 182, in _apply
    param.data = fn(param.data)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/torch/nn/modules/module.py", line 249, in <lambda>
    return self._apply(lambda t: t.cuda(device))
RuntimeError: torch.cuda.FloatTensor is not enabled.```

Any idea ? Thanks