The usage of GPU's memory have big difference on c++ and python

#1

when i load the params and json file on windows in c++,the usage of GPU’s memory have 1.4G,but when i i load the params and json file on linux in c++,the usage of GPU’s memory have 0.7G,could someone tell me why?

#2

Can you try to run the MXNet profiler? https://mxnet.incubator.apache.org/versions/master/tutorials/python/profiler.html

profiler.set_config(profile_memory=True, aggregate_stats=True, filename='profile_output.json')

This will profile the memory usage and it should hopefully make clear what causes the difference.

#3

thanks,but i think it will not help me。

#4

I also got a similar problem.

The same model can only run with python, c++ version cannot run directly, but if I adjust the input size to be smaller, it ran without problem.

both python and c++ code are on Linux platform

#5

你这个是你模型原因吧,训练的输入和c++的输入要一致。