blhprasanna99 / speech_emotion_detection

Speech_Emotion_detection-SVM,RF,DT,MLP
MIT License
20 stars 1 forks source link

question #2

Closed ljy1998-cool closed 4 years ago

ljy1998-cool commented 4 years ago

In CNN_SpeechEmotion.ipynb when i run cnnhistory=model.fit(x_traincnn, y_train, batch_size=20, epochs=500, validation_data=(x_testcnn, y_test))

there is an error could you please tell me how to solve this problem

/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/tensor_util.py in make_tensor_proto(values, dtype, shape, verify_shape, allow_broadcast) 437 else: 438 if values is None: --> 439 raise ValueError("None values not supported.") 440 # if dtype is provided, forces numpy array to be the type 441 # provided if possible.

ValueError: None values not supported.

blhprasanna99 commented 4 years ago

As you can see, this error is because of null values...make sure you have taken the correct dataset . Execute code as it is (the code will work ).

Tip : use google colab for less issues rather than using jupyter notebook or coventional python. Hope This helps.....

On Mon, Apr 20, 2020, 6:22 PM ljy1998-cool notifications@github.com wrote:

In CNN_SpeechEmotion.ipynb when i run cnnhistory=model.fit(x_traincnn, y_train, batch_size=20, epochs=500, validation_data=(x_testcnn, y_test))

there is an error could you please tell me how to solve this problem

/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/tensor_util.py in make_tensor_proto(values, dtype, shape, verify_shape, allow_broadcast) 437 else: 438 if values is None: --> 439 raise ValueError("None values not supported.") 440 # if dtype is provided, forces numpy array to be the type 441 # provided if possible.

ValueError: None values not supported.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/blhprasanna99/speech_emotion_detection/issues/2, or unsubscribe https://github.com/notifications/unsubscribe-auth/AL7GHL7TZEPC2NPJELVFA6LRNRAQHANCNFSM4MMNH6SQ .

ljy1998-cool commented 4 years ago

Yes,i use google colab,and my dataset is ravdess here is all information about my error

/usr/local/lib/python3.6/dist-packages/keras/engine/training.py in fit(self, x, y, batch_size, epochs, verbose, callbacks, validation_split, validation_data, shuffle, class_weight, sample_weight, initial_epoch, steps_per_epoch, validation_steps, validation_freq, max_queue_size, workers, use_multiprocessing, **kwargs) 1211 else: 1212 fit_inputs = x + y + sample_weights -> 1213 self._make_train_function() 1214 fit_function = self.train_function 1215

/usr/local/lib/python3.6/dist-packages/keras/engine/training.py in _make_train_function(self) 314 training_updates = self.optimizer.get_updates( 315 params=self._collected_trainable_weights, --> 316 loss=self.total_loss) 317 updates = self.updates + training_updates 318

/usr/local/lib/python3.6/dist-packages/keras/legacy/interfaces.py in wrapper(*args, *kwargs) 89 warnings.warn('Update your ' + object_name + ' call to the ' + 90 'Keras 2 API: ' + signature, stacklevel=2) ---> 91 return func(args, **kwargs) 92 wrapper._original_function = func 93 return wrapper

/usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py in symbolic_fn_wrapper(*args, kwargs) 73 if _SYMBOLIC_SCOPE.value: 74 with get_graph().as_default(): ---> 75 return func(*args, *kwargs) 76 else: 77 return func(args, kwargs)

/usr/local/lib/python3.6/dist-packages/keras/optimizers.py in get_updates(self, loss, params) 274 new_a = self.rho a + (1. - self.rho) K.square(g) 275 self.updates.append(K.update(a, new_a)) --> 276 new_p = p - lr * g / (K.sqrt(new_a) + self.epsilon) 277 278 # Apply constraints.

/usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/math_ops.py in binary_op_wrapper(x, y) 986 try: 987 y = ops.convert_to_tensor_v2( --> 988 y, dtype_hint=x.dtype.base_dtype, name="y") 989 except TypeError: 990 # If the RHS is not a tensor, it might be a tensor aware object

/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/ops.py in convert_to_tensor_v2(value, dtype, dtype_hint, name) 1281 name=name, 1282 preferred_dtype=dtype_hint, -> 1283 as_ref=False) 1284 1285

/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/ops.py in convert_to_tensor(value, dtype, name, as_ref, preferred_dtype, dtype_hint, ctx, accepted_result_types) 1339 1340 if ret is None: -> 1341 ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref) 1342 1343 if ret is NotImplemented:

/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/constant_op.py in _constant_tensor_conversion_function(v, dtype, name, as_ref) 319 asref=False): 320 = as_ref --> 321 return constant(v, dtype=dtype, name=name) 322 323

/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/constant_op.py in constant(value, dtype, shape, name) 260 """ 261 return _constant_impl(value, dtype, shape, name, verify_shape=False, --> 262 allow_broadcast=True) 263 264

/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/constant_op.py in _constant_impl(value, dtype, shape, name, verify_shape, allow_broadcast) 298 tensor_util.make_tensor_proto( 299 value, dtype=dtype, shape=shape, verify_shape=verify_shape, --> 300 allow_broadcast=allow_broadcast)) 301 dtype_value = attr_value_pb2.AttrValue(type=tensor_value.tensor.dtype) 302 const_tensor = g._create_op_internal( # pylint: disable=protected-access

/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/tensor_util.py in make_tensor_proto(values, dtype, shape, verify_shape, allow_broadcast) 437 else: 438 if values is None: --> 439 raise ValueError("None values not supported.") 440 # if dtype is provided, forces numpy array to be the type 441 # provided if possible.

ValueError: None values not supported.

blhprasanna99 commented 4 years ago

Check for null values in all the inputs which you are giving to the model and replace them with mean.....

On Mon, Apr 20, 2020, 7:00 PM ljy1998-cool notifications@github.com wrote:

Yes,i use google colab,and my dataset is ravdess here is all information about my error

/usr/local/lib/python3.6/dist-packages/keras/engine/training.py in fit(self, x, y, batch_size, epochs, verbose, callbacks, validation_split, validation_data, shuffle, class_weight, sample_weight, initial_epoch, steps_per_epoch, validation_steps, validation_freq, max_queue_size, workers, use_multiprocessing, **kwargs) 1211 else: 1212 fit_inputs = x + y + sample_weights -> 1213 self._make_train_function() 1214 fit_function = self.train_function 1215

/usr/local/lib/python3.6/dist-packages/keras/engine/training.py in _make_train_function(self) 314 training_updates = self.optimizer.get_updates( 315 params=self._collected_trainable_weights, --> 316 loss=self.total_loss) 317 updates = self.updates + training_updates 318

/usr/local/lib/python3.6/dist-packages/keras/legacy/interfaces.py in wrapper(*args, *kwargs) 89 warnings.warn('Update your ' + object_name + ' call to the ' + 90 'Keras 2 API: ' + signature, stacklevel=2) ---> 91 return func(args, **kwargs) 92 wrapper._original_function = func 93 return wrapper

/usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py in symbolic_fn_wrapper(*args, kwargs) 73 if _SYMBOLIC_SCOPE.value: 74 with get_graph().as_default(): ---> 75 return func(*args, *kwargs) 76 else: 77 return func(args, kwargs)

/usr/local/lib/python3.6/dist-packages/keras/optimizers.py in get_updates(self, loss, params) 274 new_a = self.rho a + (1. - self.rho) K.square(g) 275 self.updates.append(K.update(a, new_a)) --> 276 new_p = p - lr * g / (K.sqrt(new_a) + self.epsilon) 277 278 # Apply constraints.

/usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/math_ops.py in binary_op_wrapper(x, y) 986 try: 987 y = ops.convert_to_tensor_v2( --> 988 y, dtype_hint=x.dtype.base_dtype, name="y") 989 except TypeError: 990 # If the RHS is not a tensor, it might be a tensor aware object

/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/ops.py in convert_to_tensor_v2(value, dtype, dtype_hint, name) 1281 name=name, 1282 preferred_dtype=dtype_hint, -> 1283 as_ref=False) 1284 1285

/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/ops.py in convert_to_tensor(value, dtype, name, as_ref, preferred_dtype, dtype_hint, ctx, accepted_result_types) 1339 1340 if ret is None: -> 1341 ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref) 1342 1343 if ret is NotImplemented:

/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/constant_op.py in _constant_tensor_conversion_function(v, dtype, name, as_ref) 319 asref=False): 320 = as_ref --> 321 return constant(v, dtype=dtype, name=name) 322 323

/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/constant_op.py in constant(value, dtype, shape, name) 260 """ 261 return _constant_impl(value, dtype, shape, name, verify_shape=False, --> 262 allow_broadcast=True) 263 264

/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/constant_op.py in _constant_impl(value, dtype, shape, name, verify_shape, allow_broadcast) 298 tensor_util.make_tensor_proto( 299 value, dtype=dtype, shape=shape, verify_shape=verify_shape, --> 300 allow_broadcast=allow_broadcast)) 301 dtype_value = attr_value_pb2.AttrValue(type=tensor_value.tensor.dtype) 302 const_tensor = g._create_op_internal( # pylint: disable=protected-access

/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/tensor_util.py in make_tensor_proto(values, dtype, shape, verify_shape, allow_broadcast) 437 else: 438 if values is None: --> 439 raise ValueError("None values not supported.") 440 # if dtype is provided, forces numpy array to be the type 441 # provided if possible.

ValueError: None values not supported.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/blhprasanna99/speech_emotion_detection/issues/2#issuecomment-616554066, or unsubscribe https://github.com/notifications/unsubscribe-auth/AL7GHL7PRYFOYZ36F54QSUTRNRE6ZANCNFSM4MMNH6SQ .

ljy1998-cool commented 4 years ago

thank you !!but i am still learning this,could you please teach me how to check for null values in all the inputs ?