admin管理员组文章数量:1291798
I am working on a framework that uses pytorch_geometric
graph data stored in the usual way in data.x
and data.edge_index
Additionally, the data loading process appends multiple other keys to that data object, such as the path to the database or the model's name, both as strings. Now, I would like to see which of those additional fields in the data has how much memory consumption. The goal is to slim those data representations down to increase the batch size while training.
I know that within pytorch geometric, there is the function get_data_size, but it only displays the total theoretical memory consumption. I am also unsure what "theoretical" means in this case.
I`ve tried to do this to see the difference in memory consumption when deleting a key in data, but for the fields with strings in them, this gave 0, which does not make sense to me.
for key in data.keys():
start = get_data_size(data)
print(start)
del data[key]
end = get_data_size(data)
print(f"Safed: {start-end} by deleteing {key}")
本文标签: pytorchHow to investigate memory consumption of pytorchgeometric dataStack Overflow
版权声明:本文标题:pytorch - How to investigate memory consumption of pytorch_geometric data - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741538794a2384192.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论