Repository: magenta/magenta

Issue:
KeyError: 'tfds_data_dir'(GANSynth)
Hi, I got this error on GANSynth demo colab . How can I resolve it?

![image](https://user-images.githubusercontent.com/43649503/91554417-0a7d2400-e96a-11ea-9905-893c535b196a.png)



Discussion:
I have the same problem 
> I have the same problem

Same here
Same... Does anybody know how to fix it?

I cannot reproduce this error. Instead I get a different error: 

`AttributeError: 'PrefetchDataset' object has no attribute 'make_initializable_iterator'`

I will put in a fix for this new error.
I actually got the error above when I ran the colab demo on GANSynth. So I ran the code in Read.me using my local device which gave me the error in this thread.
Thank you.
Which line in the README gave you this error?
`gansynth_generate --ckpt_dir=/path/to/acoustic_only --output_dir=/path/to/output/dir --midi_file=/path/to/file.mid`
I bet it's similar with this one: https://github.com/magenta/magenta/issues/1794
I pip installed gansynth, and it gave me this error.
@jesseengel FYI

Yes, this is an unfortunate issue where the model restoration requires the train dataset to be loaded. Rather than refactoring this legacy code, I created #1851 a bandaid.
Aha... thank you. Does the colab demo have to work now? I still get the following error.
`AttributeError: 'PrefetchDataset' object has no attribute 'make_initializable_iterator'`
Plus there is an additional version error.
`ERROR: kfac 0.2.3 has requirement tensorflow-probability==0.8, but you'll have tensorflow-probability 0.11.0 which is incompatible.
ERROR: tensor2tensor 1.15.7 has requirement tensorflow-probability==0.7.0, but you'll have tensorflow-probability 0.11.0 which is incompatible.`
You can ignore the version error. The Colab will work again once #1850 is in and we push the new pip package. Probably later today.
Thank you so much:) Keep up the great work! 👍 

Resolving patch:
diff --git a/magenta/models/gansynth/gansynth_generate.py b/magenta/models/gansynth/gansynth_generate.py
--- a/magenta/models/gansynth/gansynth_generate.py
+++ b/magenta/models/gansynth/gansynth_generate.py
@@ -50,6 +50,9 @@
 absl.flags.DEFINE_float('secs_per_instrument', 6.0,
                         'In random interpolations, the seconds it takes to '
                         'interpolate from one instrument to another.')
+absl.flags.DEFINE_string('tfds_data_dir',
+                         'gs://tfds-data/datasets',
+                         'Data directory for the TFDS dataset used to train.')
 
 FLAGS = absl.flags.FLAGS
 tf.logging.set_verbosity(tf.logging.INFO)
@@ -59,7 +62,11 @@ def main(unused_argv):
   absl.flags.FLAGS.alsologtostderr = True
 
   # Load the model
-  flags = lib_flags.Flags({'batch_size_schedule': [FLAGS.batch_size]})
+  flags = lib_flags.Flags(
+      {
+          'batch_size_schedule': [FLAGS.batch_size],
+          'tfds_data_dir': FLAGS.tfds_data_dir
+      })
   model = lib_model.Model.load_from_path(FLAGS.ckpt_dir, flags)
 
   # Make an output directory if it doesn't exist
diff --git a/magenta/version.py b/magenta/version.py
--- a/magenta/version.py
+++ b/magenta/version.py
@@ -18,4 +18,4 @@
 pulling in all the dependencies in __init__.py.
 """
 
-__version__ = '2.1.2'
+__version__ = '2.1.3'


Test patch: