yardencsGitHub / tweetynet

Hybrid convolutional-recurrent neural networks for segmentation of birdsong and classification of elements
BSD 3-Clause "New" or "Revised" License
47 stars 9 forks source link

ValueError: the following options from TRAIN section in the config file 'gy6or6_train.toml' are not valid: {'models'} #220

Closed WalidERRAIS closed 1 year ago

WalidERRAIS commented 1 year ago

Hi, I followed your automated annotation tutorial on ubuntu 20.04.5 LTS. The preparation step of the training data set works. When I perform the command vak prep gy6or6_train.toml, it generates csv, log and npz files. At the training stage of the neural network when I perform the command vak train gy6or6_train.toml I have the following error

Traceback (most recent call last):
  File "/home/walid/anaconda3/envs/tweetynet_test_env/bin/vak", line 10, in <module>
    sys.exit(main())
  File "/home/walid/anaconda3/envs/tweetynet_test_env/lib/python3.10/site-packages/vak/__main__.py", line 48, in main
    cli.cli(command=args.command, config_file=args.configfile)
  File "/home/walid/anaconda3/envs/tweetynet_test_env/lib/python3.10/site-packages/vak/cli/cli.py", line 49, in cli
    COMMAND_FUNCTION_MAP[command](toml_path=config_file)
  File "/home/walid/anaconda3/envs/tweetynet_test_env/lib/python3.10/site-packages/vak/cli/cli.py", line 8, in train
    train(toml_path=toml_path)
  File "/home/walid/anaconda3/envs/tweetynet_test_env/lib/python3.10/site-packages/vak/cli/train.py", line 29, in train
    cfg = config.parse.from_toml_path(toml_path)
  File "/home/walid/anaconda3/envs/tweetynet_test_env/lib/python3.10/site-packages/vak/config/parse.py", line 200, in from_toml_path
    return from_toml(config_toml, toml_path, sections)
  File "/home/walid/anaconda3/envs/tweetynet_test_env/lib/python3.10/site-packages/vak/config/parse.py", line 149, in from_toml
    are_options_valid(config_toml, section_name, toml_path)
  File "/home/walid/anaconda3/envs/tweetynet_test_env/lib/python3.10/site-packages/vak/config/validators.py", line 120, in are_options_valid
    raise ValueError(err_msg)
ValueError: the following options from TRAIN section in the config file 'gy6or6_train.toml' are not valid:
{'models'}

The contents of my file gy6or_train.toml :

[PREP]
data_dir = "/home/walid/stage_Walid/tweetynet_3/data/train/gy6or6/032212"
output_dir = "/home/walid/stage_Walid/tweetynet_3/data/train"
audio_format = "wav"
annot_format = "simple-seq"
labelset = "iabcdefghjk"
train_dur = 50
val_dur = 15

[SPECT_PARAMS]
fft_size = 512
step_size = 64

[DATALOADER]
window_size = 176

[TRAIN]
models = "TweetyNet"
root_results_dir = "/home/walid/stage_Walid/tweetynet_3/data/train/results"
batch_size = 8
num_epochs = 2
normalize_spectrograms = true
val_step = 400
ckpt_step = 200
patience = 4
dataset_path = "/home/walid/stage_Walid/tweetynet_3/data/train/032212_prep_230314_105047.csv"
device = "cpu"

[TweetyNet.optimizer]
lr = 0.001

[TweetyNet.network]
hidden_size = 256
NickleDave commented 1 year ago

Hi @WalidERRAIS can you let us know what versions of vak and tweetynet you have installed?

I'm guessing you have the alpha of version 1.0 installed of off conda-forge?
In which case changing the name of the option "models" to "model" should fix.

We need to update the tutorial, sorry about that!

WalidERRAIS commented 1 year ago

Hi. Changing the name option "models" to "model" in the toml file fixed my problem, thank you. My vak version is 1.0.0a1 and tweetynet version is 0.9.0