项目“Cifar100预测增强之Paddle2.0高层API实现”https://aistudio.baidu.com/aistudio/projectdetail/1541646?channelType=0&channel=0
我用AI Studio高级版,连续运行到cell:
visualdl=paddle.callbacks.VisualDL(log_dir='visual_log')
model.fit(train_dataset,
eval_dataset,
epochs=train_parameters['epoch_num'],
batch_size=train_parameters['batch_size'],
shuffle=True,#每个EPOCH打乱一次样本,少许提升训练效果
verbose=1,
save_dir='./model/',
save_freq=1,
callbacks=[visualdl])
报错:
SystemError: (Fatal) Operator elementwise_add raises an paddle::memory::allocation::BadAlloc exception.
The exception content is
:ResourceExhaustedError:
Out of memory error on GPU 0. Cannot allocate 98.000244MB memory on GPU 0, available memory is only 38.750000MB.
Please check whether there is any other process using GPU 0.
1. If yes, please stop them, or start PaddlePaddle on another GPU.
2. If no, please decrease the batch size of your model.
(at /paddle/paddle/fluid/memory/allocation/cuda_allocator.cc:69)
. (at /paddle/paddle/fluid/imperative/tracer.cc:172)
大家可以可以正常运行吗?
我这没问题啊,点击右上角-代码执行器-重启执行器再全部运行试试?每次运行完成后再次运行可以重启下执行器
刷新下释放内存
我的还是老样子,即使“重启执行器”,难道环境还认人?不可能啊!到底哪里有问题?
你可以正常运行?
这个报错就是显存不够用了,不行把batch_size调成1试试
看看项目运行页面“系统监控”里显存占用情况