salesforce / salesforce/LayoutDETR

Download link to `layoutnet_ads_banner_dataset.pth.tar` missing?

Open
#7 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
107
Forks
16
PR merge metrics
No merged PRs in 30d

Description

When I run train.py or evaluate.py, the script always fails, probably because there is no pre-trained LayoutNet model for LayoutFID computation. Is it possible to share the weights?

Evaluating metrics...
Traceback (most recent call last):
  File "train.py", line 313, in <module>
    main() # pylint: disable=no-value-for-parameter
  File "/home/jupyter/tmp/conda_envs/layoutdetr/lib/python3.8/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/home/jupyter/tmp/conda_envs/layoutdetr/lib/python3.8/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/home/jupyter/tmp/conda_envs/layoutdetr/lib/python3.8/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/jupyter/tmp/conda_envs/layoutdetr/lib/python3.8/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "train.py", line 308, in main
    launch_training(c=c, desc=desc, outdir=opts.outdir, dry_run=opts.dry_run)
  File "train.py", line 99, in launch_training
    subprocess_fn(rank=0, c=c, temp_dir=temp_dir)
  File "train.py", line 47, in subprocess_fn
    training_loop.training_loop(rank=rank, **c)
  File "/home/jupyter/pending/LayoutDETR/training/training_loop.py", line 419, in training_loop
    result_dict = metric_main.calc_metric(metric=metric, run_dir=run_dir, G=snapshot_data['G_ema'],
  File "/home/jupyter/pending/LayoutDETR/metrics/metric_main.py", line 53, in calc_metric
    results = _metric_dict[metric](opts)
  File "/home/jupyter/pending/LayoutDETR/metrics/metric_main.py", line 93, in layout_fid50k_train
    layout_fid = layout_frechet_inception_distance.compute_layout_fid(opts, max_real=None, num_gen=50000)
  File "/home/jupyter/pending/LayoutDETR/metrics/layout_frechet_inception_distance.py", line 25, in compute_layout_fid
    mu_real, sigma_real = metric_utils_layout.compute_feature_stats_for_dataset(
  File "/home/jupyter/pending/LayoutDETR/metrics/metric_utils_layout.py", line 230, in compute_feature_stats_for_dataset
    detector_obj = get_feature_detector(pth=detector_pth, device=opts.device, num_gpus=opts.num_gpus, rank=opts.rank, verbose=progress.verbose)
  File "/home/jupyter/pending/LayoutDETR/metrics/metric_utils_layout.py", line 53, in get_feature_detector
    _feature_detector_cache[key] = LayoutFID(pth, device)
  File "/home/jupyter/pending/LayoutDETR/metrics/metric_layoutnet.py", line 32, in __init__
    state_dict = torch.load(pth, map_location=device)
  File "/home/jupyter/tmp/conda_envs/layoutdetr/lib/python3.8/site-packages/torch/serialization.py", line 699, in load
    with _open_file_like(f, 'rb') as opened_file:
  File "/home/jupyter/tmp/conda_envs/layoutdetr/lib/python3.8/site-packages/torch/serialization.py", line 230, in _open_file_like
    return _open_file(name_or_buffer, mode)
  File "/home/jupyter/tmp/conda_envs/layoutdetr/lib/python3.8/site-packages/torch/serialization.py", line 211, in __init__
    super(_open_file, self).__init__(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: 'pretrained/layoutnet_ads_banner_dataset.pth.tar'

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with train.py and evaluate.py, then trace the reported failure through metrics/metric_main.py, metrics/layout_frechet_inception_distance.py, and metrics/metric_utils_layout.py. Verify how pretrained/layoutnet_ads_banner_dataset.pth.tar is expected to be obtained; done means the documented file is available at that path and LayoutFID evaluation no longer fails with FileNotFoundError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.