Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Fix bug in tools/analyse_logs.py caused by wrong plot_iter in some cases. #1428

Merged
merged 3 commits into from
Apr 5, 2022

Conversation

MengzhangLI
Copy link
Contributor

Motivation

Fix #1426

Current in tools/analyse_logs.py we assert whether certain line in log.json is validation rather than training set by:

  if pre_iter > epoch_logs['iter'][idx]:
      continue

It's OK in many cases like below 32000 (pre_iter) > 250 (epoch_logs['iter'][idx]).

It is in ConvNeXt, whose validation step is 16000. Of course, 16000, 32000, 48000 and so on those values > 250.
Note that 250 is related with number of images in validation sets.
image

However, in certain cases when (1) valitaion is large and (2) validation step is small, like below:

image
The valition has 1334 images and validation step is 200. So 200 (pre_iter) < 1334 (epoch_logs['iter'][idx]). And it would generate many 1334 in plot_iters which makes a horizontal line segment in lr figure:

image

Solution

Using paragraph below to assert whther to keep values in training set.

  if epoch_logs['mode'][idx] == 'train':
      plot_iters.append(epoch_logs['iter'][idx])
      plot_values.append(epoch_logs[metric][idx])

Result

Take logfile.zip from #1426 for example:

LR before:
image

LR after:
image

Loss before:
image

Loss after:
image

@MeowZheng MeowZheng merged commit dfcc0b6 into open-mmlab:master Apr 5, 2022
mob5566 pushed a commit to mob5566/mmsegmentation that referenced this pull request Apr 13, 2022
… some cases. (open-mmlab#1428)

* fix_analyze_logs

* fix comments

* fix comments
ZhimingNJ pushed a commit to AetrexTechnology/mmsegmentation that referenced this pull request Jun 29, 2022
… some cases. (open-mmlab#1428)

* fix_analyze_logs

* fix comments

* fix comments
@MengzhangLI MengzhangLI deleted the fix_analyze_logs branch July 15, 2022 03:36
aravind-h-v pushed a commit to aravind-h-v/mmsegmentation that referenced this pull request Mar 27, 2023
* [wip] attention block updates

* [wip] unCLIP unet decoder and super res

* [wip] unCLIP prior transformer

* [wip] scheduler changes

* [wip] text proj utility class

* [wip] UnCLIPPipeline

* [wip] kakaobrain unCLIP convert script

* [unCLIP pipeline] fixes re: @patrickvonplaten

remove callbacks

move denoising loops into call function

* UNCLIPScheduler re: @patrickvonplaten

Revert changes to DDPMScheduler. Make UNCLIPScheduler, a modified
DDPM scheduler with changes to support karlo

* mask -> attention_mask re: @patrickvonplaten

* [DDPMScheduler] remove leftover change

* [docs] PriorTransformer

* [docs] UNet2DConditionModel and UNet2DModel

* [nit] UNCLIPScheduler -> UnCLIPScheduler

matches existing unclip naming better

* [docs] SchedulingUnCLIP

* [docs] UnCLIPTextProjModel

* refactor

* finish licenses

* rename all to attention_mask and prep in models

* more renaming

* don't expose unused configs

* final renaming fixes

* remove x attn mask when not necessary

* configure kakao script to use new class embedding config

* fix copies

* [tests] UnCLIPScheduler

* finish x attn

* finish

* remove more

* rename condition blocks

* clean more

* Apply suggestions from code review

* up

* fix

* [tests] UnCLIPPipelineFastTests

* remove unused imports

* [tests] UnCLIPPipelineIntegrationTests

* correct

* make style

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A small bug in tools/analyse_logs.py caused by wrong plot_iter in some cases.
2 participants