Getting errors using the Embedding Extraction code in the Model Card for msv2 and msv3

#2
by rwilkseo - opened

I'm getting this error when running the code on the Embedding Extraction code, and I get this when trying miewid-msv2 and miewid-msv3. Looks like an issue with changing structure of an underlying function? Thanks for any help

Error

AttributeError: 'MiewIdNet' object has no attribute 'all_tied_weights_keys'

Code Ran

model_tag = f"conservationxlabs/miewid-msv2"
model = AutoModel.from_pretrained(model_tag, trust_remote_code=True)

def generate_random_image(height=440, width=440, channels=3):
random_image = np.random.randint(0, 256, (height, width, channels), dtype=np.uint8)
return Image.fromarray(random_image)

random_image = generate_random_image()

preprocess = transforms.Compose([
transforms.Resize((440, 440)),
transforms.ToTensor(),
transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]),
])

input_tensor = preprocess(random_image)
input_batch = input_tensor.unsqueeze(0)

with torch.no_grad():
output = model(input_batch)

print(output)
print(output.shape)

Did this bug got resolved, as currently I am also getting this error upon loading the model ?

It hasn't resolved yet, but I think the solution might be to use an older version of the transformer package

Yea its working with 4.40.0 version of transformers, thanks :)

Sign up or log in to comment