Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model Upload Failed when EMA activated in model #250

Open
gurbain opened this issue Apr 22, 2024 · 0 comments
Open

Model Upload Failed when EMA activated in model #250

gurbain opened this issue Apr 22, 2024 · 0 comments

Comments

@gurbain
Copy link

gurbain commented Apr 22, 2024

Hello,

I'm trying to uplad a custom trained model based on yolov8l on roboflow in order to make my annotating process simpler. I have trained my model using ultralytics v8.2.2.

However, when I try to use the deploy function, I get the following error:

  File "[...]/python3.10/site-packages/roboflow/core/version.py", line 468, in deploy
    if isinstance(model["model"].names, list):
AttributeError: 'NoneType' object has no attribute 'names'

After some research, I realized that my model's weight are saved in model["ema"] and not in model["model"]. I replaced it and it simply like this in the file versions.py:

        elif "yolov5" in model_type or "yolov7" in model_type or "yolov9" in model_type:
            try:
                import torch
            except ImportError:
                raise (
                    "The torch python package is required to deploy yolov5 models."
                    " Please install it with `pip install torch`"
                )

        model = torch.load(os.path.join(model_path, filename))
        model["model"] = model["ema"]

Now, it uploads but I get the following error on the Roboflow platform:

Model Upload Failed
This model upload failed. A failure usually occurs because of an older, incompatible model version or possibly a new type we don't currently have support for.

I can't find how to disable EMA during training. Is there anything I can do to make this work?
Best regards!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant