LINCellularNeuroscience/VAME

Unable to evaluate_model(), softplus error in eval_temporal()

Guillermo-Hidalgo-Gadea opened this issue · 2 comments

Hi Kevin, hi Pavol,

I am trying to train a new model, so far so good, but evaluate_model() keeps killing the kernel, regardless where I run the function (e.g., Jupyter Notebook, IPython or as .py script). Using 36Gb RAM and RTX 3090 with 40Gb ...

After re-installing Anaconda and the vame environment from scratch, the error in vame.evaluate_model() mutated to a KeyError: 'softplus' from eval_temporal()

Type 'copyright', 'credits' or 'license' for more information
IPython 7.29.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import vame
Using CUDA
GPU active: True
GPU used: NVIDIA GeForce RTX 3090

In [2]: config = "config.yaml"

In [3]: vame.evaluate_model(config)
Using CUDA
GPU active: True
GPU used: NVIDIA GeForce RTX 3090


Evaluation of VAME model.

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-3-fa9d8d111bc0> in <module>
----> 1 vame.evaluate_model(config)

C:\ProgramData\Anaconda3\envs\vame\lib\site-packages\vame-1.0-py3.7.egg\vame\model\evaluate.py in evaluate_model(config)
    182
    183     print("\n\nEvaluation of %s model. \n" %model_name)
--> 184     eval_temporal(cfg, use_gpu, model_name, legacy)
    185
    186     print("You can find the results of the evaluation in '/Your-VAME-Project-Apr30-2020/model/evaluate/' \n"

C:\ProgramData\Anaconda3\envs\vame\lib\site-packages\vame-1.0-py3.7.egg\vame\model\evaluate.py in eval_temporal(cfg, use_gpu, model_name, legacy)
    128     dropout_rec = cfg['dropout_rec']
    129     dropout_pred = cfg['dropout_pred']
--> 130     softplus = cfg['softplus']
    131
    132     filepath = os.path.join(cfg['project_path'],"model")

C:\ProgramData\Anaconda3\envs\vame\lib\site-packages\ruamel\yaml\comments.py in __getitem__(self, key)
    925         # type: (Any) -> Any
    926         try:
--> 927             return ordereddict.__getitem__(self, key)
    928         except KeyError:
    929             for merged in getattr(self, merge_attrib, []):

KeyError: 'softplus'

Any idea what could be causing the problem? Is my model too bad or maybe I am using too much data (7500 * 8sec * 59Hz with test_fraction: 0.1)?

Best Regards from Bochum

Hi Guillermo,

this is most likely caused because you don't have the key softplus in your config.yaml. I think the easiest way is to add this to your config.yaml as sotfplus: False. Otherweise, you could also overwrite line 130 in the evaluate.py script with softplus = False.

The current VAME version allows you to select if you want to use the softplus activation in your model but might be a bit buggy. I hope this helps and lets you evaluate your model.

Cheers,
Kevin

Hi Kevin,

indeed, that was it!

Thank you 🥇