deepgram / kur

Descriptive Deep Learning
Apache License 2.0
814 stars 107 forks source link

kur deepgram10 error #41

Closed saurabhvyas closed 7 years ago

saurabhvyas commented 7 years ago

I was following along the instructions and I encountered this error , I am using ubuntu 16.04 with only CPU

(kur) saurabh@saurabh-Inspiron-5559:~/kur/examples$  kur train speech.yml
[WARNING 2017-03-20 12:51:58,410 py.warnings:86] /home/saurabh/.virtualenvs/kur/lib/python3.5/site-packages/keras/legacy/interfaces.py:86: UserWarning: Update your `Conv1D` call to the Keras 2 API: `Conv1D(padding="valid", strides=2, activation="linear", filters=1000, kernel_size=11, name="..convolution.0")`
  '` call to the Keras 2 API: ' + signature)

Traceback (most recent call last):
  File "/home/saurabh/.virtualenvs/kur/lib/python3.5/site-packages/tensorflow/python/framework/tensor_shape.py", line 557, in merge_with
    self.assert_same_rank(other)
  File "/home/saurabh/.virtualenvs/kur/lib/python3.5/site-packages/tensorflow/python/framework/tensor_shape.py", line 603, in assert_same_rank
    "Shapes %s and %s must have the same rank" % (self, other))
ValueError: Shapes (11, 161, 1000) and (?, ?, ?, ?) must have the same rank

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/saurabh/.virtualenvs/kur/lib/python3.5/site-packages/tensorflow/python/framework/tensor_shape.py", line 633, in with_rank
    return self.merge_with(unknown_shape(ndims=rank))
  File "/home/saurabh/.virtualenvs/kur/lib/python3.5/site-packages/tensorflow/python/framework/tensor_shape.py", line 564, in merge_with
    (self, other))
ValueError: Shapes (11, 161, 1000) and (?, ?, ?, ?) are not compatible

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/saurabh/.virtualenvs/kur/bin/kur", line 11, in <module>
    sys.exit(main())
  File "/home/saurabh/.virtualenvs/kur/lib/python3.5/site-packages/kur/__main__.py", line 269, in main
    sys.exit(args.func(args) or 0)
  File "/home/saurabh/.virtualenvs/kur/lib/python3.5/site-packages/kur/__main__.py", line 48, in train
    func = spec.get_training_function()
  File "/home/saurabh/.virtualenvs/kur/lib/python3.5/site-packages/kur/kurfile.py", line 282, in get_training_function
    model = self.get_model(provider)
  File "/home/saurabh/.virtualenvs/kur/lib/python3.5/site-packages/kur/kurfile.py", line 148, in get_model
    self.model.build()
  File "/home/saurabh/.virtualenvs/kur/lib/python3.5/site-packages/kur/model/model.py", line 282, in build
    self.build_graph(input_nodes, output_nodes, network)
  File "/home/saurabh/.virtualenvs/kur/lib/python3.5/site-packages/kur/model/model.py", line 339, in build_graph
    target=layer
  File "/home/saurabh/.virtualenvs/kur/lib/python3.5/site-packages/kur/backend/keras_backend.py", line 238, in connect
    return target(inputs)
  File "/home/saurabh/.virtualenvs/kur/lib/python3.5/site-packages/keras/engine/topology.py", line 554, in __call__
    output = self.call(inputs, **kwargs)
  File "/home/saurabh/.virtualenvs/kur/lib/python3.5/site-packages/keras/layers/convolutional.py", line 156, in call
    dilation_rate=self.dilation_rate[0])
  File "/home/saurabh/.virtualenvs/kur/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py", line 2824, in conv1d
    data_format=tf_data_format)
  File "/home/saurabh/.virtualenvs/kur/lib/python3.5/site-packages/tensorflow/python/ops/nn_ops.py", line 639, in convolution
    op=op)
  File "/home/saurabh/.virtualenvs/kur/lib/python3.5/site-packages/tensorflow/python/ops/nn_ops.py", line 308, in with_space_to_batch
    return op(input, num_spatial_dims, padding)
  File "/home/saurabh/.virtualenvs/kur/lib/python3.5/site-packages/tensorflow/python/ops/nn_ops.py", line 631, in op
    name=name)
  File "/home/saurabh/.virtualenvs/kur/lib/python3.5/site-packages/tensorflow/python/ops/nn_ops.py", line 87, in _non_atrous_convolution
    filter_shape = filter.get_shape().with_rank(input.get_shape().ndims)
  File "/home/saurabh/.virtualenvs/kur/lib/python3.5/site-packages/tensorflow/python/framework/tensor_shape.py", line 635, in with_rank
    raise ValueError("Shape %s must have rank %d" % (self, rank))
ValueError: Shape (11, 161, 1000) must have rank 4
ajsyp commented 7 years ago

This was caused by an upstream change: last week, Keras 2.0 was released, which broke backwards compatibility with Keras 1. Kur has since been updated to support both Keras 1.x and 2.0, but you should upgrade to 0.4.0rc0 or just install directly from a git clone. To do the latter:

git clone https://github.com/deepgram/kur.git
cd kur
pip install -e .

(benefit of this method, using -e, is that simply doing a git pull from that directory will update Kur for you)

saurabhvyas commented 7 years ago

It solved this problem , Thank you , I am still new to deep learning :)