JMGaljaard/fltk-testbed

Download of datasets fails because of wrong parameter names

Closed this issue · 2 comments

Bug Report

Current Behavior
Running python3 -m fltk extractor ./configs/example_cloud_experiment.json from the project root, after having successfully installed requirements-cpu.txt, fails with the following message:

/fltk-testbed/venv/lib/python3.8/site-packages/dataclasses_json/core.py:171: RuntimeWarning: `NoneType` object value of non-optional type config_path detected when decoding DistributedConfig.
  warnings.warn(f"`NoneType` object {warning}.", RuntimeWarning)
No argument path is provided.
Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/fltk-testbed/fltk/__main__.py", line 93, in <module>
    __main__()
  File "/fltk-testbed/fltk/__main__.py", line 74, in __main__
    __run_op_dict[args.action](arg_path, conf_path,
  File "/fltk-testbed/fltk/launch.py", line 122, in launch_extractor
    download_datasets(args, conf)
  File "/fltk-testbed/fltk/core/distributed/extractor.py", line 22, in download_datasets
    data_path = config.get_data_path()
AttributeError: 'NoneType' object has no attribute 'get_data_path'

Expected behavior/code
Datasets should be downloaded to data dir.

Environment

  • Python version: 3.8
  • Platform: Windows (WSL 2)

Possible Solution
Seems to be caused by a mismatch between the parameter name for the configuration.
Provided (config):

__run_op_dict[args.action](arg_path, conf_path,
rank=_save_get(args, 'rank'),
parser=parser,
nic=_save_get(args, 'nic'),
host=_save_get(args, 'host'),
prefix=_save_get(args, 'prefix'),
args=args,
config=distributed_config)

Expected (conf):

fltk-testbed/fltk/launch.py

Lines 111 to 122 in f8fb18d

def launch_extractor(base_path: Path, config_path: Path, args: Namespace = None, conf: DistributedConfig = None,
**kwargs):
"""
Extractor launch function, will only download all models and quit execution.
@param args: Arguments passed from CLI.
@type args: Namespace
@param conf: Parsed configuration file passed from the CLI.
@type conf: Optional[DistributedConfig]
@return: None
@rtype: None
"""
download_datasets(args, conf)

Hi @AbeleMM, thank you for the extensive bug report, I will issue a fix later today!

I issued a fix on the development branch, an update to the course template will be issued later, but you can also git git patch to foward yourself @AbeleMM .