DeepLab V3+:ResourceExhaustedError (see above for traceback): OOM when allocating tensor of shape

本文详细介绍了在使用DeepLabV3+进行图像分割训练时遇到的显存溢出问题及解决方案。通过调整训练批次大小和禁用批归一化更新,成功避免了GPU内存不足的错误,使训练得以顺利进行。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在跑DeepLab V3+时遇到ResourceExhaustedError (see above for traceback): OOM when allocating tensor of shape错误

GPU:1060/6G

github:https://github.com/tensorflow/models/tree/master/research/deeplab

是显存不够了,把local_test.sh文件中

python "${WORK_DIR}"/train.py \

--logtostderr \

--train_split="trainval" \

--model_variant="xception_65" \

--atrous_rates=6 \

--atrous_rates=12 \

--atrous_rates=18 \

--output_stride=16 \

--decoder_output_stride=4 \

--train_crop_size=513 \

--train_crop_size=513 \

--train_batch_size=4 \

--training_number_of_steps="${NUM_ITERATIONS}" \

--fine_tune_batch_norm=true \  <==============改这行

--tf_initial_checkpoint="${INIT_FOLDER}/deeplabv3_pascal_train_aug/model.ckpt" \

--train_logdir="${TRAIN_LOGDIR}" \

--dataset_dir="${PASCAL_DATASET}"

改为

python "${WORK_DIR}"/train.py \

--logtostderr \

--train_split="trainval" \

--model_variant="xception_65" \

--atrous_rates=6 \

--atrous_rates=12 \

--atrous_rates=18 \

--output_stride=16 \

--decoder_output_stride=4 \

--train_crop_size=513 \

--train_crop_size=513 \

--train_batch_size=1 \

--training_number_of_steps="${NUM_ITERATIONS}" \

--fine_tune_batch_norm=false \

--tf_initial_checkpoint="${INIT_FOLDER}/deeplabv3_pascal_train_aug/model.ckpt" \

--train_logdir="${TRAIN_LOGDIR}" \

--dataset_dir="${PASCAL_DATASET}"

之后正常训练

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值