【发布时间】:2021-05-09 14:18:19
【问题描述】:
我正在尝试分析我的模型的内存消耗,如下所述: https://pytorch.org/tutorials/recipes/recipes/profiler_recipe.html
使用这些行:
with profiler.profile(profile_memory=True, record_shapes=True) as prof:
tubes, _, _ = zip(*model(imgs, img_metas, return_loss=False))
print(prof.key_averages().table(sort_by="self_cpu_memory_usage", row_limit=10))
但我收到此错误
TypeError: init() 得到了一个意外的关键字参数 'profile_memory'
那么,这个错误的原因和/或解决方案是什么?
【问题讨论】:
-
能否在问题中包含完整的代码
-
您使用的 PyTorch 版本是什么?
-
pytorch 1.1.0, py3.7_cuda10.0.130_cudnn7.5.1_0
-
为了包含完整的代码,我认为是无关紧要的。