You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from tensorflow.keras.layers import Dense, Input
from tensorflow.keras.models import Model
import scipy
import numpy as np
trainX = scipy.sparse.random(1024, 1024)
trainY = np.random.rand(1024, 2)
inputs = Input(shape=(trainX.shape[1],), sparse=True)
outputs = Dense(trainY.shape[1], activation='softmax')(inputs)
model = Model(inputs=inputs, outputs=outputs)
model.compile(loss='categorical_crossentropy', optimizer='adam', metrics=['accuracy'])
steps = 10
for i in range(steps):
# For simplicity, we directly use trainX and trainY in this example
# Usually, this is where batches are prepared
print(model.train_on_batch(trainX, trainY))
tf.saved_model.save(model, "TFKerasModel/abctest")
I load this model use golang
but i don;t know how to put the feature into this model
as this python model example: How do i append the SparseTensor?
input as (indices,values,dense_shape)
The text was updated successfully, but these errors were encountered: