fact-project / aict-tools

Reproducible Artificial Intelligence for Cherenkov Telescopes
MIT License
6 stars 6 forks source link

Training energy regressor fails #111

Closed afattorini closed 4 years ago

afattorini commented 4 years ago
  File "/net/nfshome/home/afattorini/.conda/envs/fact/bin/aict_train_energy_regressor", line 8, in <module>
    sys.exit(main())
  File "/net/nfshome/home/afattorini/.conda/envs/fact/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/net/nfshome/home/afattorini/.conda/envs/fact/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/net/nfshome/home/afattorini/.conda/envs/fact/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/net/nfshome/home/afattorini/.conda/envs/fact/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/net/nfshome/home/afattorini/.conda/envs/fact/lib/python3.7/site-packages/aict_tools/scripts/train_energy_regressor.py", line 38, in main
    config = AICTConfig.from_yaml(configuration_path)
  File "/net/nfshome/home/afattorini/.conda/envs/fact/lib/python3.7/site-packages/aict_tools/configuration.py", line 91, in from_yaml
    return cls(yaml.load(f))
  File "/net/nfshome/home/afattorini/.conda/envs/fact/lib/python3.7/site-packages/aict_tools/configuration.py", line 120, in __init__
    self.energy = EnergyConfig(config)
  File "/net/nfshome/home/afattorini/.conda/envs/fact/lib/python3.7/site-packages/aict_tools/configuration.py", line 233, in __init__
    self.features.extend(gen_config['features'].keys())
AttributeError: 'NoneType' object has no attribute 'keys'
maxnoe commented 4 years ago

The reason is that you have feature_generation: features set to nothing:

energy:
    ...
    feature_generation:
        needed_columns:
          - foo
          - bar
        features:
             # nothing here

If you don't want to use the feature generation, don't give these config options. Maybe we should generate a more helpful error message.