avoiding n_train_batches in meta-data dump from locals().  Not sure why it does not work, but it can be recovered from the rest of the file, so forget it.