Hi,
I’m new to ray and struggle with the function size restriction.
“ValueError: The remote function main.predict is too large (97 MiB > FUNCTION_SIZE_ERROR_THRESHOLD=95 MiB).”
I saw that other people had the same problem and tried to apply the suggested solutions. However, unfortunately I did not manage.
This is a reduced version of my code:
# Start Ray cluster
ray.init(num_cpus=num_cpus, ignore_reinit_error=True)
# val is an array representing an image
ref = ray.put(val)
@ray.remote
def predict(ref):
pred = classification_model(ray.get(ref)).softmax(0) # resnet50 model
class_id = preds.argmax().item()
result_refs = [ ]
result_refs.append(predict.remote(ref))
results = ray.get(result_refs)
My code is supposed to parallelize a pipeline for hundreds of images in the end and this is the core of it.
Maybe someone knows a solution?
Cheers!