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