Open minghigh opened 7 years ago
Hi there,
I am facing a similar problem when loading weights file:
TypeError: Indexing elements must be in increasing order
This error seems to have the same cause as above. I am using same libraries set of @minghigh, but running on mac.
Thanks for pointing this out!
The weights were saved from Theano 0.9.0 using the 'tf' dim ordering–it looks like they don't work with the TensorFlow backend (tested on CentOS 7.3 with both TF/Theano installed and the packages you listed; tf backend gives the same unorderable types error, but Theano works).
I'll see if I can figure out a way to make the weights interoperable (assuming that this is some sort of configuration mistake on my end). In the meantime, switching to Theano should hopefully resolve the issue (don't forget to change ~/.keras/keras.json
):
{
"backend": "theano",
"image_dim_ordering": "tf"
}
I have the same problem $ python acapellabot.py test.mp3 Using TensorFlow backend. ('\x1b[33m', 'Model has 668225 params', '\x1b[0m') ('\x1b[33m', "Weights provided; performing inference on ['test.mp3']...", '\x1b[0m') ('\x1b[1m', 'Loading weights', '\x1b[0m') Traceback (most recent call last): File "acapellabot.py", line 145, in acapellabot.loadWeights(args.weights) File "acapellabot.py", line 88, in loadWeights self.model.load_weights(path) File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 2500, in load_weights load_weights_from_hdf5_group(f, self.layers) File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 2900, in load_weights_from_hdf5_group original_backend) File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 2841, in preprocess_weights_for_loading weights[0] = conv_utils.convert_kernel(weights[0]) File "/usr/local/lib/python2.7/dist-packages/keras/utils/conv_utils.py", line 86, in convert_kernel return np.copy(kernel[slices]) File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper (/tmp/pip_build_root/h5py/h5py/_objects.c:2840) File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper (/tmp/pip_build_root/h5py/h5py/_objects.c:2798) File "/usr/local/lib/python2.7/dist-packages/h5py/_hl/dataset.py", line 474, in getitem selection = sel.select(self.shape, args, dsid=self.id) File "/usr/local/lib/python2.7/dist-packages/h5py/_hl/selections.py", line 90, in select sel[args] File "/usr/local/lib/python2.7/dist-packages/h5py/_hl/selections.py", line 361, in getitem raise TypeError("Indexing elements must be in increasing order") TypeError: Indexing elements must be in increasing order
My environment as following: ubuntu 14.04 Python 2.7.6 tensorflow (1.0.1) tensorflow-gpu (1.0.1) Keras (2.0.3) h5py (2.7.0) librosa (0.5.0)
I change the backend to theano but have the new problem:
File "acapellabot.py", line 130, in None
.
@arlose Regarding the "channel dimension of the inputs should be defined. Found None." issue–You're probably using the th
dimension ordering; the trained weights were saved in tf
ordering. Could you try opening ~/keras/keras.json
and specifying tf
ordering:
{
"backend": "theano",
"image_dim_ordering": "tf"
}
I think there's a way to set the ordering in the script itself, so I'll see if I can do that to save people some trouble in the future.
@arlose Also, are you running python 3? From the printout it looks like you're using python 2, but it won't work in python 2 without some adjustments (the issue you're getting there is because of the change in behavior of the division operator, you could probably fix it with some calls to round()
)
@madebyollin thanks i just resolved it
Hi @madebyollin , Is this issue resolved with Tensorflow backend? Or still we need to use Theano backend?
Kindly confirm.
Thanks
when I run the following code (demo.mp3 is my example music)
got errors :
My environment as following:
In Window 10.