Closed SmileTM closed 3 years ago
@SmileTM it is not really convenient to full passed an entire code and ask for a code review like that. Maybe can you give more details as for example in which line do you get this error please ? Thank you.
in last line of the code : index.save(path) the error info is 'input_signature' error.
your can pass the code to run.
Thanks, @anisayari - it would definitely help if you could put this in a colab we could run, @SmileTM .
The issue is that you need to call the index
layer using tensors or numpy arrays, not just lists:
_, titles = index({"user_id": np.array(["32"]) ,"user_occupation_label": np.array([20])})
With this modification it should save just fine.
Thanks, @anisayari - it would definitely help if you could put this in a colab we could run, @SmileTM .
The issue is that you need to call the
index
layer using tensors or numpy arrays, not just lists:_, titles = index({"user_id": np.array(["32"]) ,"user_occupation_label": np.array([20])})
With this modification it should save just fine.
thank you!!it really works well. I also want to paste the code in colab , but colab cannot be opened in China. QAQ. I'm sorry to add unnecessary trouble to you.
error info :
TypeError: Invalid input_signature [{'user_id': [None], 'user_occupation_label': [TensorSpec(shape=(), dtype=tf.int32, name=None)]}]; input_signature must be a possibly nested sequence of TensorSpec objects.
the code in here, how to fix it?