运行resnet50程序时,出现这个错误。
**原代码地址:**https://github.com/calmisential/TensorFlow2.0_ResNet
错误显示:
ResourceExhaustedError: OOM when allocating tensor with shape[512] and type float on /job:localhost/replica:0/task:0/device:GPU:0 by allocator GPU_0_bfc
[[node res_net_type_ii_3/sequential_64/bottle_neck_53/batch_normalization_218/FusedBatchNormV3 (defined at C:\Users\Tangliny\anaconda3\envs\tensorflow_gpu\lib\site-packages\tensorflow_core\python\framework\ops.py:1751) ]]
Hint: If you want to see a list of allocated tensors when OOM happens, add report_tensor_allocations_upon_oom to RunOptions for current allocation info.
[Op:__inference_train_step_81730]
Function call stack:
train_step
**错误原因:**网络tensor太大,训练时参数太多,显存不够用。资源耗尽错误。
解决办法:
调节参数,将batch_size改小一半左右。
同时关闭其他正在runing的程序,其他无关的软件都关闭。
精简模型,结构里面如果有con2v好