question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

GANSynth KeyError: 'tfds_data_dir'

See original GitHub issue

Hi, by two days the GANSynth’s Colab Demo give me an error on Environment Setup:

Load model from /content/gansynth/acoustic_only/stage_00012/./model.ckpt-11000000
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-1-bad1649e76e0> in <module>()
     65 tf.reset_default_graph()
     66 flags = lib_flags.Flags({'batch_size_schedule': [BATCH_SIZE]})
---> 67 model = lib_model.Model.load_from_path(CKPT_DIR, flags)
     68 
     69 # Helper functions

4 frames
/usr/local/lib/python3.6/dist-packages/magenta/models/gansynth/lib/model.py in load_from_path(cls, path, flags)
    175     batch_size = flags.get('eval_batch_size',
    176                            train_util.get_batch_size(stage_id, **flags))
--> 177     model = cls(stage_id, batch_size, flags)
    178     model.saver.restore(model.sess, ckpt)
    179     return model

/usr/local/lib/python3.6/dist-packages/magenta/models/gansynth/lib/model.py in __init__(self, stage_id, batch_size, config)
    191     """
    192     data_helper = data_helpers.registry[config['data_type']](config)
--> 193     real_images, real_one_hot_labels = data_helper.provide_data(batch_size)
    194 
    195     # gen_one_hot_labels = real_one_hot_labels

/usr/local/lib/python3.6/dist-packages/magenta/models/gansynth/lib/data_helpers.py in provide_data(self, batch_size)
     64     with tf.name_scope('inputs'):
     65       with tf.device('/cpu:0'):
---> 66         dataset = self.dataset.provide_dataset()
     67         dataset = dataset.shuffle(buffer_size=1000)
     68         dataset = dataset.map(self._map_fn, num_parallel_calls=4)

/usr/local/lib/python3.6/dist-packages/magenta/models/gansynth/lib/datasets.py in provide_dataset(self)
    116       return wave, one_hot_label, label, example['instrument']['source']
    117 
--> 118     dataset = self._get_dataset_from_tfds()
    119     dataset = dataset.map(
    120         _parse_nsynth, num_parallel_calls=tf.data.experimental.AUTOTUNE)

/usr/local/lib/python3.6/dist-packages/magenta/models/gansynth/lib/datasets.py in _get_dataset_from_tfds(self)
     65       dataset = tfds.load(
     66           'nsynth/gansynth_subset:2.3.*',
---> 67           data_dir=self._config['tfds_data_dir'],
     68           split=tfds.Split.TRAIN,
     69           download=False)

KeyError: 'tfds_data_dir'

How can I resolve?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jamesliucommented, Nov 23, 2020

I still have the same issue even after updating magenta to 2.1.3 with pip install -U magenta. Is the fix already in the latest version? Thanks. Screen Shot 2020-11-23 at 10 55 19 AM

0reactions
adarobcommented, Sep 8, 2020

Try now. This should be fixed!

Read more comments on GitHub >

github_iconTop Results From Across the Web

KeyError: 'tfds_data_dir'(GANSynth) #1800 - GitHub
Hi, I got this error on GANSynth demo colab . ... Point gansynth_generate at the public tfds data dir to avoid crashing…
Read more >
[1902.08710] GANSynth: Adversarial Neural Audio Synthesis
Abstract: Efficient audio synthesis is an inherently difficult machine learning task, as human perception is sensitive to both global ...
Read more >
GANSynth: Making music with GANs - Magenta
In this post, we introduce GANSynth, a method for generating high-fidelity audio with Generative Adversarial Networks (GANs).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found