Ma-Dan / keras-yolo4

A Keras implementation of YOLOv4 (Tensorflow backend)
MIT License
382 stars 175 forks source link

训练时候总是出现nan #4

Open tanghaojie1 opened 4 years ago

tanghaojie1 commented 4 years ago

loss和val loss总是出现nan

chunleiml commented 4 years ago

loss和val loss总是出现nan

在哪里设置图像路径的?

wenchao1993 commented 4 years ago

loss和val loss总是出现nan 我也是训练时loss和val出现nan, 然后发现把input图片的尺寸改成612x612,可以缓解这个问题。

6457tang commented 4 years ago

loss和val loss总是出现nan 我也是训练时loss和val出现nan, 然后发现把input图片的尺寸改成612x612,可以缓解这个问题。 我设置成612之后还是有这个问题

tanghaojie1 commented 4 years ago

loss和val loss总是出现nan 我也是训练时loss和val出现nan, 然后发现把input图片的尺寸改成612x612,可以缓解这个问题。 我设置成612之后还是有这个问题 他说的完善 感觉还是他的代码不太完善,是不是损失函数有问题

Ma-Dan commented 4 years ago

损失函数是有问题,也可能是权重初始化的参数有问题(那部分来源于yolov3),在加载预训练权重的前提下可以训练,这两部分都需要重写

robisen1 commented 4 years ago

损失函数是有问题,也可能是权重初始化的参数有问题(那部分来源于yolov3),在加载预训练权重的前提下可以训练,这两部分都需要重写

Have you had a chance to fix the issues in train? thanks

Kuuuo commented 4 years ago

我是训练过程中mAP出现nan,这是什么问题呢?

Epoch 25/50 loss: [2.29048967][0][2.29048967][0] 1234/1234 [==============================] - 398s 323ms/step - loss: 3.6579.30782938][0][4.30782938][0]]] Epoch end eval mAP on weight logs/000/ep025-loss3.658.h5 Epoch 25 mAP nan

Mahmood-Hussain commented 3 years ago

我是训练过程中mAP出现nan,这是什么问题呢?

Epoch 25/50 loss: [2.29048967][0][2.29048967][0] 1234/1234 [==============================] - 398s 323ms/step - loss: 3.6579.30782938][0][4.30782938][0]]] Epoch end eval mAP on weight logs/000/ep025-loss3.658.h5 Epoch 25 mAP nan

@Kuuuo have you been able to solve it?

Kuuuo commented 3 years ago

Maybe the learning rate is set too large

------------------ 原始邮件 ------------------ 发件人: "Ma-Dan/keras-yolo4" @.>; 发送时间: 2021年6月4日(星期五) 下午2:36 @.>; @.**@.>; 主题: Re: [Ma-Dan/keras-yolo4] 训练时候总是出现nan (#4)

我是训练过程中mAP出现nan,这是什么问题呢?

Epoch 25/50 loss: [2.29048967][0][2.29048967][0] 1234/1234 [==============================] - 398s 323ms/step - loss: 3.6579.30782938][0][4.30782938][0]]] Epoch end eval mAP on weight logs/000/ep025-loss3.658.h5 Epoch 25 mAP nan

@Kuuuo have you been able to solve it?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

Mahmood-Hussain commented 3 years ago

Maybe the learning rate is set too large ------------------ 原始邮件 ------------------ 发件人: "Ma-Dan/keras-yolo4" @.>; 发送时间: 2021年6月4日(星期五) 下午2:36 @.>; @.**@.>; 主题: Re: [Ma-Dan/keras-yolo4] 训练时候总是出现nan (#4) 我是训练过程中mAP出现nan,这是什么问题呢? Epoch 25/50 loss: [2.29048967][0][2.29048967][0] 1234/1234 [==============================] - 398s 323ms/step - loss: 3.6579.30782938][0][4.30782938][0]]] Epoch end eval mAP on weight logs/000/ep025-loss3.658.h5 Epoch 25 mAP nan @Kuuuo have you been able to solve it? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

Thank You for your quick response. by decreasing the learning rate did it solve your problem?

Kuuuo commented 3 years ago

yes

------------------ 原始邮件 ------------------ 发件人: "Ma-Dan/keras-yolo4" @.>; 发送时间: 2021年6月4日(星期五) 下午2:45 @.>; @.**@.>; 主题: Re: [Ma-Dan/keras-yolo4] 训练时候总是出现nan (#4)

Maybe the learning rate is set too large … ------------------ 原始邮件 ------------------ 发件人: "Ma-Dan/keras-yolo4" @.>; 发送时间: 2021年6月4日(星期五) 下午2:36 @.>; @.@.>; 主题: Re: [Ma-Dan/keras-yolo4] 训练时候总是出现nan (#4) 我是训练过程中mAP出现nan,这是什么问题呢? Epoch 25/50 loss: [2.29048967][0][2.29048967][0] 1234/1234 [==============================] - 398s 323ms/step - loss: 3.6579.30782938][0][4.30782938][0]]] Epoch end eval mAP on weight logs/000/ep025-loss3.658.h5 Epoch 25 mAP nan @Kuuuo have you been able to solve it? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

Thank You for your quick response. by decreasing the learning rate did it solve your problem?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

Mahmood-Hussain commented 3 years ago

yes ------------------ 原始邮件 ------------------ 发件人: "Ma-Dan/keras-yolo4" @.>; 发送时间: 2021年6月4日(星期五) 下午2:45 @.>; @.**@.>; 主题: Re: [Ma-Dan/keras-yolo4] 训练时候总是出现nan (#4) Maybe the learning rate is set too large … ------------------ 原始邮件 ------------------ 发件人: "Ma-Dan/keras-yolo4" @.>; 发送时间: 2021年6月4日(星期五) 下午2:36 @.>; @.@.>; 主题: Re: [Ma-Dan/keras-yolo4] 训练时候总是出现nan (#4) 我是训练过程中mAP出现nan,这是什么问题呢? Epoch 25/50 loss: [2.29048967][0][2.29048967][0] 1234/1234 [==============================] - 398s 323ms/step - loss: 3.6579.30782938][0][4.30782938][0]]] Epoch end eval mAP on weight logs/000/ep025-loss3.658.h5 Epoch 25 mAP nan @Kuuuo have you been able to solve it? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. Thank You for your quick response. by decreasing the learning rate did it solve your problem? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

Great! thanks

Mahmood-Hussain commented 3 years ago

@Kuuuo can you tell me what learning rate you set and what is anchor.txt file ?

wangzhengzzz commented 3 years ago

函数损失是有问题,也可能是权重初始化的参数有问题(那部分来自yolov3),在加载预训练重的基础可以训练,这部分权利都需要补充

您好!请问可以自己修改损失函数来解决loss为nan的问题吗?在哪里修改呢