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

OOM when allocating tensor with shape[1,1080,1920,3] [[Node: ToFloat = Cast[DstT=DT_FLOAT, SrcT=DT_UINT8, _device="/job:localhost/replica:0/task:0/device:CPU:0"] #59

Open
Lixueqingqq opened this issue Jan 23, 2018 · 2 comments

Comments

@Lixueqingqq
Copy link

我用tensorflow object detection api 中的train.py 设置的参数为
--logtostderr
--pipeline_config_path=D:/My_project/jiezouzhe/faster_rcnn_resnet50_pets.config
--train_dir=D:/My_project/jiezouzhe/train_log2
--num_clones=2
--ps_tasks=1
训练90张图片,batchsize=2,我两块GPU,GPU型号:GTX1080 运行时(totalMemory: 11.00GiB freeMemory: 9.10GiB)
也报了同样的错:
tensorflow.python.framework.errors_impl.ResourceExhaustedError: OOM when allocating tensor with shape[1,1080,1920,3]
[[Node: ToFloat = CastDstT=DT_FLOAT, SrcT=DT_UINT8, _device="/job:localhost/replica:0/task:0/device:CPU:0"]]
而且不是一开始出错,我是跑了34步后出错的,很崩溃啊,不知道问题出在哪儿

@491506870
Copy link

哈喽,你有解决这个问题吗?我另外的项目里也遇到这个问题,不知道怎么解决。

@Lixueqingqq
Copy link
Author

试一试将GPU配置改一下,tensorflow object detection api 中默认的运行GPU时,申请GPU全部内存,如果内存没有得到适时释放,就有可能出现内存泄漏,所以可以设置动态申请内存:
session_config.gpu_options.allow_growth=True
实现GPU动态分配内存

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

2 participants