8000 Training · Issue #5 · tue-mps/eomt · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Training #5

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

Closed
Haon0206 opened this issue Apr 15, 2025 · 3 comments
Closed

Training #5

Haon0206 opened this issue Apr 15, 2025 · 3 comments

Comments

@Haon0206
Copy link
Haon0206 commented Apr 15, 2025

I encountered an error while reproducing semantic segmentation on the ADE20K dataset.
How should I resolve it? Looking forward to your reply, thank you very much.

Image

@NiccoloCavagnero
Copy link
Collaborator
NiccoloCavagnero commented Apr 15, 2025

Could you please share the command used to launch the training?

Following the README, I was not able to reproduce your error.

@Haon0206
Copy link
Author
Haon0206 commented Apr 16, 2025

The command I use for training is:python3 main.py fit -c configs/ade20k/semantic/eomt_large_512.yaml,I have modified the YAML file as follows:

trainer:
  max_epochs: 31
  logger:
    class_path: lightning.pytorch.loggers.wandb.WandbLogger
    init_args:
      resume: allow
      project: "eomt"
      name: "ade20k_semantic_eomt_large_512"
  devices: 1
model:
  class_path: training.mask_classification_semantic.MaskClassificationSemantic
  init_args:
    attn_mask_annealing_enabled: True
    attn_mask_annealing_start_steps: [6520, 13040, 19560, 26080]
    attn_mask_annealing_end_steps: [13040, 19560, 26080, 32600]
    img_size: 512  
    num_classes: 150 
    network:
      class_path: models.eomt.EoMT
      init_args:
        num_q: 100
        num_blocks: 5
        encoder:
          class_path: models.vit.ViT
data:
  class_path: datasets.ade20k_semantic.ADE20KSemantic
  batch_size: 4
  path: "/root/autodl-tmp/zhj/eomt-master/datasets"

I initially trained the command according to the README command as follows:

python3 main.py fit \
  -c configs/ade20k/semantic/eomt_large_512.yaml \
  --trainer.devices 1 \
  --data.batch_size 4 \
  --data.path /root/autodl-tmp/zhj/eomt-master/datasets

But we also encountered problems:yaml.representer.RepresenterError: ('cannot represent an object', NestedArg(key='path', val='/root/autodl-tmp/zhj/eomt-master/datasets'))

@NiccoloCavagnero
Copy link
Collaborator

I can see two distinct issues here:

  • incorrect configuration file format;
  • incorrect eomt configuration.

For the first case, the yaml file should be modified as follows:

data:
  class_path: datasets.ade20k_semantic.ADE20KSemantic
  init_args:
    batch_size: 4
    path: "/root/autodl-tmp/zhj/eomt-master/datasets"

Then, there is a problem in the num_blocks variable defined in your configuration file.
The variable num_blocks should be set to 4 for a ViT-L encoder. Setting it to 5 will trigger an error due to having an incorrect length for the attn_mask_annealing_start_steps and attn_mask_annealing_end_steps variables.

However, I can confirm that installing everything from scratch following the readme and then running this command with default configs correctly starts the training:

python3 main.py fit \
  -c configs/ade20k/semantic/eomt_large_512.yaml \
  --trainer.devices 1 \
  --data.batch_size 4 \
  --data.path <path_to_datasets>

Let us know if these were the cause of the problem.

Best,
Niccolò

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

No branches or pull requests

2 participants
0