Replies: 1 comment 1 reply
-
Try to replace if self.get('graph_level_feature', False): |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Dear team,
Please help me to solve this error:
run_classification(train_dataset, val_dataset, test_dataset, model, num_tasks, epochs, batch_size, vt_batch_size, lr, lr_decay_factor, lr_decay_step_size, weight_decay, early_stopping, loss, metric, log_dir, save_dir,True)
AttributeError Traceback (most recent call last)
in ()
17 save_dir=drive_path
18
---> 19 run_classification(train_dataset, val_dataset, test_dataset, model, num_tasks, epochs, batch_size, vt_batch_size, lr, lr_decay_factor, lr_decay_step_size, weight_decay, early_stopping, loss, metric, log_dir, save_dir,True)
4 frames
in run_classification(train_dataset, val_dataset, test_dataset, model, num_tasks, epochs, batch_size, vt_batch_size, lr, lr_decay_factor, lr_decay_step_size, weight_decay, early_stopping, loss_config, metric, log_dir, save_dir, evaluate, pre_train)
64 t_start = time.perf_counter()
65
---> 66 total_train_loss = train_classification(model, optimizer, train_loader, num_tasks, loss_type, criterion, device)
67
68
in train_classification(model, optimizer, train_loader, num_tasks, loss_type, criterion, device)
9 optimizer.zero_grad()
10 batch_data = batch_data.to(device)
---> 11 out = model(batch_data)
12
13 if loss_type == 'bce':
/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py in _call_impl(self, *input, **kwargs)
1100 if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks or _global_backward_hooks
1101 or _global_forward_hooks or _global_forward_pre_hooks):
-> 1102 return forward_call(*input, **kwargs)
1103 # Do not call functions when jit is used
1104 full_backward_hooks, non_full_backward_hooks = [], []
in forward(self, batch_data)
106 def forward(self, batch_data):
107
--> 108 if self.graph_level_feature: ### Use rdkit_2d_normalized_features
109 x, edge_index, edge_attr = batch_data.x, batch_data.edge_index, batch_data.edge_attr
110 row, col = edge_index
/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py in getattr(self, name)
1176 return modules[name]
1177 raise AttributeError("'{}' object has no attribute '{}'".format(
-> 1178 type(self).name, name))
1179
1180 def setattr(self, name: str, value: Union[Tensor, 'Module']) -> None:
AttributeError: 'MLNet' object has no attribute 'graph_level_feature'
Beta Was this translation helpful? Give feedback.
All reactions