votes up 5

None values not supported.

Package:
Exception Class:
ValueError

Raise code

  if isinstance(values, (np.ndarray, np.generic)):
    if dtype and dtype.is_numpy_compatible:
      nparray = values.astype(dtype.as_numpy_dtype)
    else:
      nparray = values
  else:
    if values is None:
      raise ValueError("None values not supported.")
    # if dtype is provided, forces numpy array to be the type
    # provided if possible.
    if dtype and dtype.is_numpy_compatible:
      np_dt = dtype.as_numpy_dtype
    else:
      np_dt = None
    # If shape is None, numpy.prod returns None when dtype is not set, but
😲 Agile task management is now easier than calling a taxi. #Tracklify
🙏 Scream for help to Ukraine
Today, 25th May 2022, Russia continues bombing and firing Ukraine. Don't trust Russia, they are bombing us and brazenly lying in same time they are not doing this 😠, civilians and children are dying too! We are screaming and asking exactly you to help us, we want to survive, our families, children, older ones.
Please spread the information, and ask your governemnt to stop Russia by any means. We promise to work extrahard after survival to make the world safer place for all.

Ways to fix

votes up 1 votes down

Summary: 

This exception is thrown when the make_tensor_proto function is called, and None is passed as the value for the values variable. Within the function, a check is performed to ensure that values is not None, so if values is None this exception is thrown. To avoid this exception, pass in a list or array.

Code to Reproduce the Error (WRONG):

import tensorflow.python.framework.tensor_util as utl
utl.make_tensor_proto(None)

Working Version (Fixed):

import tensorflow.python.framework.tensor_util as utl
utl.make_tensor_proto([1,2,3])
Jul 07, 2021 codingcomedyig answer

Add a possible fix

Please authorize to post fix