corynguyen19 / midi-lstm-gan

Using LSTMs and GANs to Generate Music from MIDI Files (APM Fall 2018)
83 stars 29 forks source link

ModuleNotFoundError: No module named 'tensorflow.contrib' #2

Open isaacbernat opened 5 years ago

isaacbernat commented 5 years ago

Hi, when running lstm.py, just after loading the midis I get this error:

Traceback (most recent call last):
  File "lstm.py", line 176, in <module>
    train_network()
  File "lstm.py", line 26, in train_network
    model = create_network(network_input, n_vocab)
  File "lstm.py", line 103, in create_network
    model.add(CuDNNLSTM(512,input_shape=(network_input.shape[1], network_input.shape[2]),return_sequences=True))
  File "/Users/ec/pypi_venv/lib/python3.7/site-packages/keras/engine/sequential.py", line 166, in add
    layer(x)
  File "/Users/ec/pypi_venv/lib/python3.7/site-packages/keras/layers/recurrent.py", line 541, in __call__
    return super(RNN, self).__call__(inputs, **kwargs)
  File "/Users/ec/pypi_venv/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py", line 75, in symbolic_fn_wrapper
    return func(*args, **kwargs)
  File "/Users/ec/pypi_venv/lib/python3.7/site-packages/keras/engine/base_layer.py", line 463, in __call__
    self.build(unpack_singleton(input_shapes))
  File "/Users/ec/pypi_venv/lib/python3.7/site-packages/keras/layers/cudnn_recurrent.py", line 425, in build
    from tensorflow.contrib.cudnn_rnn.python.ops import cudnn_rnn_ops
ModuleNotFoundError: No module named 'tensorflow.contrib'

I have the following packages installed via pip. Are they not the correct version?

tensorflow           2.0.0
tensorflow-estimator 2.0.1

I think having a requirements.txt might help if that's the case. Thanks!

mansura-habiba commented 4 years ago

Uninstall tensorflow 2.0.0 and install 1.15.00