Open Ronneesley opened 5 years ago
Hello again,
I changed 'self.cuda = 1' to 'self.cuda = 0' in args.py. But I got other error:
CUDA 0
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
PERSONAL_PATH/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'))
PERSONAL_PATH/GraphRNN/model.py:297: UserWarning: nn.init.constant is now deprecated in favor of nn.init.constant_.
nn.init.constant(param, 0.25)
PERSONAL_PATH/GraphRNN/model.py:302: UserWarning: nn.init.xavier_uniform is now deprecated in favor of nn.init.xavier_uniform_.
m.weight.data = init.xavier_uniform(m.weight.data, gain=nn.init.calculate_gain('relu'))
/home/ronneesley/anaconda3/lib/python3.7/site-packages/torch/nn/functional.py:1386: UserWarning: nn.functional.sigmoid is deprecated. Use torch.sigmoid instead.
warnings.warn("nn.functional.sigmoid is deprecated. Use torch.sigmoid instead.")
Traceback (most recent call last):
File "main.py", line 134, in <module>
train(args, dataset_loader, rnn, output)
File "PERSONAL_PATH/GraphRNN/train.py", line 682, in train
scheduler_rnn, scheduler_output)
File "PERSONAL_PATH/GraphRNN/train.py", line 516, in train_rnn_epoch
log_value('loss_'+args.fname, loss.data[0], epoch*args.batch_ratio+batch_idx)
IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number
Hello again,
I changed 'self.cuda = 1' to 'self.cuda = 0' in args.py. But I got other error:
CUDA 0 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 PERSONAL_PATH/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')) PERSONAL_PATH/GraphRNN/model.py:297: UserWarning: nn.init.constant is now deprecated in favor of nn.init.constant_. nn.init.constant(param, 0.25) PERSONAL_PATH/GraphRNN/model.py:302: UserWarning: nn.init.xavier_uniform is now deprecated in favor of nn.init.xavier_uniform_. m.weight.data = init.xavier_uniform(m.weight.data, gain=nn.init.calculate_gain('relu')) /home/ronneesley/anaconda3/lib/python3.7/site-packages/torch/nn/functional.py:1386: UserWarning: nn.functional.sigmoid is deprecated. Use torch.sigmoid instead. warnings.warn("nn.functional.sigmoid is deprecated. Use torch.sigmoid instead.") Traceback (most recent call last): File "main.py", line 134, in <module> train(args, dataset_loader, rnn, output) File "PERSONAL_PATH/GraphRNN/train.py", line 682, in train scheduler_rnn, scheduler_output) File "PERSONAL_PATH/GraphRNN/train.py", line 516, in train_rnn_epoch log_value('loss_'+args.fname, loss.data[0], epoch*args.batch_ratio+batch_idx) IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number
I believe it is a version problem, you can change the loss.data[0] to loss.item(), and then the test code can run.
Hello @JiaxuanYou,
When I ran python3 main.py. I got the following message even after run all installations commands.