keras-io icon indicating copy to clipboard operation
keras-io copied to clipboard

Stable Diffusion protobuf incompatibility

Open randyg3000 opened this issue 3 years ago • 0 comments
trafficstars

https://keras.io/guides/keras_cv/generate_images_with_stable_diffusion/

Linux orin1 5.10.65-tegra #1 SMP PREEMPT Mon May 16 20:58:07 PDT 2022 aarch64 aarch64 aarch64 GNU/Linux

After Installing (sudo pip3 install --upgrade keras-cv and sudo pip3 install --upgrade tensorflow) I receive the following error (note I received a different error after downgrading protobuf... see below) ... File "/home/orin/.local/lib/python3.8/site-packages/google/protobuf/descriptor.py", line 560, in new _message.Message._CheckCalledFromGeneratedFile() TypeError: Descriptors cannot not be created directly. If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0. If you cannot immediately regenerate your protos, some other possible workarounds are:

  1. Downgrade the protobuf package to 3.20.x or lower.
  2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates

orin@orin1:~/keras-cv$ sudo pip3 install protobuf==3.19.*

Collecting protobuf==3.19.* Using cached protobuf-3.19.5-cp38-cp38-manylinux2014_aarch64.whl (913 kB) Installing collected packages: protobuf Attempting uninstall: protobuf Found existing installation: protobuf 3.20.1 Uninstalling protobuf-3.20.1: Successfully uninstalled protobuf-3.20.1 Successfully installed protobuf-3.19.5 orin@orin1:~/keras-cv$ python3 keras-cv-images.py Traceback (most recent call last): File "keras-cv-images.py", line 2, in import keras_cv File "/usr/local/lib/python3.8/dist-packages/keras_cv/init.py", line 16, in from keras_cv import version_check File "/usr/local/lib/python3.8/dist-packages/keras_cv/version_check.py", line 18, in import tensorflow as tf File "/usr/local/lib/python3.8/dist-packages/tensorflow/init.py", line 37, in from tensorflow.python.tools import module_util as _module_util File "/usr/local/lib/python3.8/dist-packages/tensorflow/python/init.py", line 37, in from tensorflow.python.eager import context File "/usr/local/lib/python3.8/dist-packages/tensorflow/python/eager/context.py", line 29, in from tensorflow.core.framework import function_pb2 File "/usr/local/lib/python3.8/dist-packages/tensorflow/core/framework/function_pb2.py", line 16, in from tensorflow.core.framework import attr_value_pb2 as tensorflow_dot_core_dot_framework_dot_attr__value__pb2 File "/usr/local/lib/python3.8/dist-packages/tensorflow/core/framework/attr_value_pb2.py", line 16, in from tensorflow.core.framework import tensor_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__pb2 File "/usr/local/lib/python3.8/dist-packages/tensorflow/core/framework/tensor_pb2.py", line 16, in from tensorflow.core.framework import resource_handle_pb2 as tensorflow_dot_core_dot_framework_dot_resource__handle__pb2 File "/usr/local/lib/python3.8/dist-packages/tensorflow/core/framework/resource_handle_pb2.py", line 16, in from tensorflow.core.framework import tensor_shape_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2 File "/usr/local/lib/python3.8/dist-packages/tensorflow/core/framework/tensor_shape_pb2.py", line 36, in _descriptor.FieldDescriptor( File "/home/orin/.local/lib/python3.8/site-packages/google/protobuf/descriptor.py", line 560, in new _message.Message._CheckCalledFromGeneratedFile() TypeError: Descriptors cannot not be created directly. If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0. If you cannot immediately regenerate your protos, some other possible workarounds are:

  1. Downgrade the protobuf package to 3.20.x or lower.
  2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates

randyg3000 avatar Sep 29 '22 03:09 randyg3000