首页 > 编程语言 > 详细

tensorflow.python.framework.errors_impl.ResourceExhaustedError: OOM when allocating tensor with shape[1,1424,2128,64]

时间:2020-12-10 09:30:05      阅读:29      评论:0      收藏:0      [点我收藏+]

tensorflow.python.framework.errors_impl.ResourceExhaustedError: OOM when allocating tensor with shape[1,1424,2128,64]

1、开始以为是 是显卡显存不足,没有想到是gpu问题

ref: https://www.cnblogs.com/heiao10duan/p/9083303.html

Dense(1024, activation=‘relu‘),  #将batch_size从4096改为1024因为我的显存不够
 

2、开始以为是没有选中独立显卡
# import os           #key: https://blog.csdn.net/littlehaes/article/details/82317220
# os.environ["CUDA_VISIBLE_DEVICES"] = "2"    #ref: https://www.cnblogs.com/ying-chease/p/9473938.html
                                            #ref: https://www.cnblogs.com/darkknightzh/archive/2004/01/13/8576825.html
                                            # ref:http://www.voidcn.com/article/p-xhpiftyw-bte.html
                                            # ref:https://blog.csdn.net/weixin_43301333/article/details/108854504
# os.environ[‘TF_CPP_MIN_LOG_LEVEL‘] = ‘2‘    # ref:https://blog.csdn.net/zqx951102/article/details/88897117
                                            # ref:https://www.imooc.com/article/details/id/289425
                                        
3、 后来通过list_local_devices发现是没有装TensorFlow-gpu, install TensorFlow-gpu
# from tensorflow.python.client import device_lib
# print(device_lib.list_local_devices())
# https://blog.csdn.net/littlehaes/article/details/82317220

tensorflow.python.framework.errors_impl.ResourceExhaustedError: OOM when allocating tensor with shape[1,1424,2128,64]

原文:https://www.cnblogs.com/carl2380/p/14111746.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!