Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An RuntimeError:There were no tensor arguments to this function #32

Open
gr986 opened this issue Apr 6, 2021 · 3 comments
Open

An RuntimeError:There were no tensor arguments to this function #32

gr986 opened this issue Apr 6, 2021 · 3 comments

Comments

@gr986
Copy link

gr986 commented Apr 6, 2021

I used my own dataset, and the following error occurred. How can I change it? Thanks!

Traceback (most recent call last):
File "D:/g/project/Expression2graph/learndxs/S_Pretra/my_pretrain_combine.py", line 243, in
main()
File "D:/g/project/Expression2graph/learndxs/S_Pretra/my_pretrain_combine.py", line 235, in main
train_loss, train_acc_pair, train_acc_node = train(args, model_list, loader, optimizer_list, device)
File "D:/g/project/Expression2graph/learndxs/S_Pretra/my_pretrain_combine.py", line 52, in train
for step, batch in enumerate(loader):
File "C:\Users\11708\Desktop\minikangda\envs\pytorch\lib\site-packages\torch\utils\data\dataloader.py", line 345, in next
data = self._next_data()
File "C:\Users\11708\Desktop\minikangda\envs\pytorch\lib\site-packages\torch\utils\data\dataloader.py", line 385, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "C:\Users\11708\Desktop\minikangda\envs\pytorch\lib\site-packages\torch\utils\data_utils\fetch.py", line 47, in fetch
return self.collate_fn(data)
File "D:\g\project\Expression2graph\learndxs\S_Pretra\my_dataloader.py", line 55, in
collate_fn=lambda data_list: BatchMaskingAndSubstructContext.from_data_list(data_list),
File "D:\g\project\Expression2graph\learndxs\S_Pretra\my_batch.py", line 260, in from_data_list
batch[key] = torch.cat(batch[key], dim=batch.cat_dim(key))
RuntimeError: There were no tensor arguments to this function (e.g., you passed an empty list of Tensors), but no fallback function is registered for schema aten::_cat. This usually means that this function requires a non-empty list of Tensors. Available functions are [CPUTensorId, CUDATensorId, QuantizedCPUTensorId, VariableTensorId]

@weihua916
Copy link
Collaborator

Seems to be related to this issue: #14

@gr986
Copy link
Author

gr986 commented Apr 8, 2021

Now, I have a new question:

Traceback (most recent call last):
File "D:/g/project/Expression2graph/learndxs/S_Pretra/my_pretrain_combine.py", line 309, in
main()
File "D:/g/project/Expression2graph/learndxs/S_Pretra/my_pretrain_combine.py", line 299, in main
train_loss, train_acc_node = train(args, model_list, loader, optimizer_list, device)
File "D:/g/project/Expression2graph/learndxs/S_Pretra/my_pretrain_combine.py", line 55, in train
node_rep = model(batch.x, batch.edge_index, batch.edge_attr)
File "C:\Users\11708\Desktop\minikangda\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 550, in call
result = self.forward(*input, **kwargs)
File "D:\g\project\Expression2graph\learndxs\S_Pretra\my_model.py", line 290, in forward
h = self.gnns[layer](h_list[layer], edge_index, edge_attr)
File "C:\Users\11708\Desktop\minikangda\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 550, in call
result = self.forward(*input, **kwargs)
File "D:\g\project\Expression2graph\learndxs\S_Pretra\my_model.py", line 54, in forward
return self.propagate(edge_index, x=x, edge_attr=edge_embeddings)
TypeError: propagate() missing 1 required positional argument: 'edge_index'

@funihang
Copy link

Hello,

Have you solved your first problem yet? I tried the method in #14 but still cannot solve it. Do you have any suggestions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants