Tensorflow 2.3.0 requirement is protobuf 3.8.0 or higher , but tensorflow imports only at protobuf 3.6.0(for python 3.6.0, windows)

Viewed 1028

I ran this code(https://keras.io/getting_started/intro_to_keras_for_engineers/#building-models-with-the-keras-functional-api):-

from tensorflow import keras
from tensorflow.keras.layers.experimental.preprocessing import CenterCrop
from tensorflow.keras.layers.experimental.preprocessing import Rescaling
import numpy as np   
from tensorflow.keras import layers

inputs = keras.Input(shape=(None, None, 3))

x = CenterCrop(height=150, width=150)(inputs)   
x = Rescaling(1.0 / 255)(x)   

x = layers.Conv2D(filters=32, kernel_size=(3, 3), activation="relu")(x)   
x = layers.MaxPooling2D(pool_size=(3, 3))(x) 
x = layers.Conv2D(filters=32, kernel_size=(3, 3), activation="relu")(x)   
x = layers.MaxPooling2D(pool_size=(3, 3))(x)   
x = layers.Conv2D(filters=32, kernel_size=(3, 3), activation="relu")(x)   
x = layers.GlobalAveragePooling2D()(x)

outputs = layers.Dense(2, activation="softmax")(x)
model = keras.Model(inputs=inputs, outputs=outputs)

data = np.random.randint(1, 256, size=(64, 200, 200, 3)).astype("float32")    
processed_data = model(data)    
print(processed_data)

SHOWS this error:- AttributeError: 'google.protobuf.pyext._message.RepeatedCompositeCo' object has no attribute 'append'

so as I upgraded the protobuf to the latest version as requirements by tensorflow(protobuf>=3.8.0).

Then the tensorflow won't get imported. Error is:- ImportError: DLL load failed: The specified procedure could not be found. (at the line import tensorflow)

so obviously I need protobuf 3.8.0 as a minimum requirement to run the program, so please help if anybody knows a solution to this problem other than downgrading protobuf to 3.6.0.

0 Answers
Related