Open MikeWangWZHL opened 1 year ago
I'm getting the same issue on dalle2_laion==1.1.0 using upsampler.example.json config.
In the InferenceScript func run
, the shape of image_embedding needs batchsize
dimension.
class ExampleInference(InferenceScript):
def run(self, text: str) :
"""
Takes a string and returns a single image.
"""
text = [text]
image_embedding_map = self._sample_prior(text)
image_embedding = image_embedding_map[0][0]
image_embedding = image_embedding.unsqueeze(0) # <- add this
image_map = self._sample_decoder(text=text, image_embed=image_embedding)
return image_map[0][0]
Thanks for the great effort. I was trying to try out the inference script with this provided example code:
But encountered
RuntimeError: mat1 and mat2 shapes cannot be multiplied (1x10 and 768x1280)
Any idea on why? Thanks!Below is the full error track back: