1
votes

I am getting the following error when tensorflow is imported:

Intel MKL ERROR: Parameter 4 was incorrect on entry to DLASCL.

Intel MKL ERROR: Parameter 4 was incorrect on entry to DLASCL. Traceback (most recent call last):
File "/xxx/skript.py", line 25, in h1 = LSTM(50)(input1) File "/xxx/anaconda3/lib/python3.6/site-packages/keras/layers/recurrent.py", line 268, in call return super(Recurrent, self).call(inputs, **kwargs)
File "/xxx/anaconda3/lib/python3.6/site-packages/keras/engine/topology.py", line 575, in call self.build(input_shapes[0])
File "/xxx/anaconda3/lib/python3.6/site-packages/keras/layers/recurrent.py", line 1034, in build constraint=self.recurrent_constraint)
File "/xxx/anaconda3/lib/python3.6/site-packages/keras/legacy/interfaces.py", line 87, in wrapper return func(*args, **kwargs)
File "/xxx/anaconda3/lib/python3.6/site-packages/keras/engine/topology.py", line 396, in add_weight weight = K.variable(initializer(shape),
File "/xxx/anaconda3/lib/python3.6/site-packages/keras/initializers.py", line 247, in call u, _, v = np.linalg.svd(a, full_matrices=False)
File "/xxx/anaconda3/lib/python3.6/site-packages/numpy/linalg/linalg.py", line 1389, in svd u, s, vt = gufunc(a, signature=signature, extobj=extobj)
File "/xxx/anaconda3/lib/python3.6/site-packages/numpy/linalg/linalg.py", line 99, in _raise_linalgerror_svd_nonconvergence raise LinAlgError("SVD did not converge") numpy.linalg.linalg.LinAlgError: SVD did not converge

Process finished with exit code 1

With a generic skript, which you can also use for testing:

import tensorflow as tf
from keras.models import Model
from keras.layers import Input
from keras.layers import Dense
from keras.layers import LSTM
from keras.layers.merge import Concatenate
import numpy as np    


# Length of sequence.
sequence_length = 300
# Number of base features 
num_features = 15
# Number of events 
num_event_features = 20

# Input 
input1 = Input(shape=(sequence_length, num_features))
# Build first LSTM on the first input.
h1 = LSTM(50)(input1)

# Apply the dense layer for prediction.
prediction = Dense(1)(h1)

# Define the keras model.
model = Model(inputs=[input1], outputs=[prediction])
model.compile(loss='binary_crossentropy', optimizer='adam',
              metrics=['accuracy'])

# Generate some random data for testing.
X1 = np.random.rand(1000, sequence_length, num_features).astype(np.float32)    
Y = np.random.choice([0, 1], size=1000).astype(np.float32)

# Train the model on random data.
model.fit(x=[X1], y=Y)

If i delete the import tensorflow as tf the network will be trained without a error message. I am using Keras 2.0.8, python 3.6 and tensorflow 1.3.0. Tensorflow was installed for Ubuntu, python 3.6 and GPU support.

1

1 Answers

1
votes

I had a similar problem, after installing mkl-service. Uninstalling it solved it for me.