Jump to content
Compvision.ru
Sign in to follow this  
mrgloom

Loss не уменьшается

Recommended Posts

Что делать если Loss не уменьшается? как лечить? как дебажить?

Пока пробовал только увеличение batch size и не помогло.

Сетка Network In Network, хотя таким страдает и SqeezeNet v1.1 (только 2 раза получилось обучить с положительным результатом и даже не получается повторить результаты на том что работало)

Share this post


Link to post
Share on other sites

 Может быть из за GPU, у меня было что то очень похожее, но вроде как это был баг 0.16 версии.

На 970 сеть училась, а на 1070 нет.

А может проблема настроек сети: 

похожий коммент

bhargavaurala commented on 8 Jan

Hi @mavenlin. I am using the NiN architecture to train ImageNet 2012. After about 50k iterations, the validation accuracy is around 0.1% which corresponds to random chance. I am using the same structure and initialization as you have. Can you please let me know when (iteration number) the validation accuracy starts to increase? This will help me decide if the network is learning anything useful and if I should restart with different hyperparameters.

Thanks.

 

Share this post


Link to post
Share on other sites

У меня было такое, что 5-10 эпох сеть не подаёт признаков жизни, а потом начинает учится или даже более экзотично не учится потом небольшой всплеск в положительную сторону и потом опять возвращается к исходному состоянию.

Как понять что хотя бы какие то положительные тендеции происходят если loss не меняется как то анализировать состояние слоёв?

 

В случае с VGG увеличения batch size помогло.

 

У меня как раз 1070, а caffe вроде master 0.15 https://github.com/NVIDIA/caffe

AlexNet учится стабильно.

 

Единственный удачный запуск SqeezeNet v1.1, который правда закончился ошибкой

https://github.com/mrgloom/kaggle-dogs-vs-cats-solution/tree/master/learning_from_scratch/Models/SqeezeNet_v1.1

Share this post


Link to post
Share on other sites

Ну если на других сетях учится, значит caffe работает.

Можно попробовать среднее вычесть, если это не делается до сих пор.

Обычно первые итерации сеть примерно этим и занимается.

Share this post


Link to post
Share on other sites

Тут https://github.com/BVLC/caffe/issues/401 пишут что

1. это может быть драйвер - с каким вы используете gtx 1070?

2. это может быть random initialization - но это вроде пофиксили.

3. это может быть weight initialization - попробую инициализировать bias константой поменьше.

тут https://github.com/BVLC/caffe/issues/3243

рекомендуют другие более продвинутые инициализации весов и batch norm

тут https://github.com/BVLC/caffe/issues/2731 рекомендуют уменьшить learning rate

 

Еще про уменьшение batch size при нехватке памяти

https://github.com/BVLC/caffe/issues/430

Цитата

 In theory when you reduce the batch_size by a factor of X then you should increase the base_lr by a factor of sqrt(X), but Alex have used a factor of X (see http://arxiv.org/abs/1404.5997)

 

Share this post


Link to post
Share on other sites

Кстати DIGITS умеет как то делать батчи больше за счет последовательной обработки при нехватке памяти. Не тестировал, но видел эту фичу.

Share this post


Link to post
Share on other sites

batch accumulation называется, на самом деле это есть и в обычном Caffe, называется iter_size и прописывать надо в solver.prototxt 

https://github.com/NVIDIA/DIGITS/blob/6b8995d89abe300f0a7bbdc11e53ce4aff5671c5/digits/model/tasks/caffe_train.py#L741

https://github.com/BVLC/caffe/pull/1977

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×