I runed the Vertex AI example shown above in cloab, when it reaches the De/serialization stage, the error message is as follows.How should I solve this problem?
ValueError: Exception encountered when calling DeSerializeInput.call(). Could not automatically infer the output shape / dtype of 'de_serialize_input' (of type DeSerializeInput). Either the `DeSerializeInput.call()` method is incorrect, or you need to implement the `DeSerializeInput.compute_output_spec() / compute_output_shape()` method. Error encountered: as_list() is not defined on an unknown TensorShape.
In addition, in another example of Hosting a Pre-trained Tree-crown Segmentation Model, a similar problem also occurred, but I was able to run it normally in November 2023.
NotImplementedError: Exception encountered when calling Lambda.call(). We could not automatically infer the shape of the Lambda's output. Please specify the `output_shape` argument for this Lambda layer.
Hi @Liulizhi,
Welcome to Google Cloud Community!
Both errors are pointing to TensorFlow's inability to automatically determine the shape and data type of the tensors being produced by specific layers in your model. This is usually due to a mismatch between the input data and the model's expectations, or a problem within a custom layer (like your DeSerializeInput or Lambda layer).
Here are some workarounds that you may try:
You can look into the TensorFlow tutorial and Best practices for implementing machine learning on Google Cloud for more information.
I hope the above information is helpful.
User | Count |
---|---|
2 | |
2 | |
1 | |
1 | |
1 |