lab4d-org/lab4d

Error when running "scripts/run_preprocess.py"

Closed this issue · 2 comments

Thank you for open-sourcing this wonderful library and tutorials!

I have encountered some issues when preprocessing customized video:

First I download a .mp4 video and put it under database/raw. When running the following commands:

python scripts/run_preprocess.py cat-pikachu-0 quad "0"

During the call of run_extract_priors in https://github.com/lab4d-org/lab4d/blob/main/scripts/run_preprocess.py#L141,
when the code is doing the canonical_registration in Line 78 of preprocess.py, the error happens when calling save_resampled_feat in which the crop2raw file for frame i is not found:

FileNotFoundError: database/processed/Annotations/Full-Resolution/cat-pikachu-0-0000/full-256-00000.txt not found.

Below is the full errors from Python:

File "/nfs/ycheng/proj/vpet/external/lab4d/scripts/run_preprocess.py", line 78, in run_extract_priors
    canonical_registration(seqname, 256, obj_class)
  File "/nfs/ycheng/proj/vpet/external/lab4d/preprocess/scripts/canonical_registration.py", line 110, in canonical_registration
    import pdb; pdb.set_trace()
  File "/nfs/ycheng/proj/vpet/external/lab4d/preprocess/scripts/canonical_registration.py", line 53, in save_resampled_feat
    crop2raw = np.loadtxt(crop2raw_path)
  File "/nfs/ycheng/anaconda3/envs/lab4d-yc/lib/python3.9/site-packages/numpy/lib/npyio.py", line 1356, in loadtxt
    arr = _read(fname, dtype=dtype, comment=comment, delimiter=delimiter,
  File "/nfs/ycheng/anaconda3/envs/lab4d-yc/lib/python3.9/site-packages/numpy/lib/npyio.py", line 975, in _read
    fh = np.lib._datasource.open(fname, 'rt', encoding=encoding)
  File "/nfs/ycheng/anaconda3/envs/lab4d-yc/lib/python3.9/site-packages/numpy/lib/_datasource.py", line 193, in open
    return ds.open(path, mode, encoding=encoding, newline=newline)
  File "/nfs/ycheng/anaconda3/envs/lab4d-yc/lib/python3.9/site-packages/numpy/lib/_datasource.py", line 533, in open
    raise FileNotFoundError(f"{path} not found.")
FileNotFoundError: database/processed/Annotations/Full-Resolution/pexels-cottonbro-6853400-0000/full-256-00000.txt not found.

Could you please point me how to solve this issue? Thanks!

Hi Yen-Chi, thanks for the report! The error was due to a recent format change of processed files. I pushed a fix. It should be consistent now but let me know if there are other issues.

Thanks for the quick reply and hot fix!