SAM
SAM copied to clipboard
Error When Specifying Multiple Ages for --target_age Parameter In Replicate
Description
When attempting to use the --target_age
parameter with a comma-separated list of ages (e.g., "0,10,20,30,40"), I encounter a ValueError during the type conversion to int in the add_aging_channel
function. It seems that the code is not handling the comma-separated string correctly and is trying to convert the entire string to an integer, which is not possible.
Steps to Reproduce
- Run the age transformation model with the
--target_age
parameter specified as a comma-separated list of ages. - Observe the error when the model attempts to process the input.
Expected behavior
I would expect the model to process each age value individually from the comma-separated list.
Actual behavior
The code fails with a ValueError because it attempts to convert the entire comma-separated string into an integer.
Error Message
Traceback (most recent call last):
File "/root/.pyenv/versions/3.8.14/lib/python3.8/site-packages/cog/serve/result.py", line 66, in predict
input_image_age = [age_transformer(input_image.cpu())].to("cuda")
File "/src/datasets/augmentations.py", line 16, in add_aging_channel
target_age = int(target_age) / 100
ValueError: invalid literal for int() with base 10: '0,10,20,30,40'
API/Model Version:
Latest: 9222a21c