Model trained via API refers to non-existent class labels

So cool!! Is the full script (without personal identifying information) something you’d be amenable to sharing in our Show & Tell section, or allowing us to include in this repo?

If you’re open to inclusion in the repo, submit a PR, and I’ll take a look and get it approved after testing.

You can call the file something like UploadLocalBySplit.js

Yeah no problem at all, I’ll have a look at a PR tomorrow :slight_smile:

I have some other stuff in this repo that could be useful JS snippets;

generateVersion

createProject

uploadWithAnnotation (for a directory of images and annotations)

getTrainingStatus

1 Like

image

No luck :frowning:

This is how the train/test split turned out, so that wasn’t the cause:

As you suggested, I’ll make another project and try this again. A shame to waste the credits

Trying it with this new project:

@Mohamed still nothing after using a name without so many numbers like you suggested:

image

Here’s something I just noticed. If I get some info about a project I’ve made using the Roboflow site:

We can see that project.classes lists the number of ‘lola’ instances:

But if I do that again for a project I’ve created using the API

(https://api.roboflow.com/iadt/lola/4?api_key=****nocache=true)

The classes are empty, despite having added 12 annotated images with the class name ‘lola’ to this one too:

Could this be the reason for the random coin-related class names?

For context, here’s how I’m creating projects:

const createProject = async (name, annotation) => {
  return new Promise(async (resolve, reject) => {
    // annotation, what are you annotating, e.g. 'fido', 'dog', 'cat', whatever the user wants
    await axios
      .post(
        `https://api.roboflow.com/iadt/projects/?api_key=${process.env.ROBOFLOW_API_KEY}`,
        {
          name: name,
          type: "object-detection",
          license: "CC BY 4.0",
          annotation: annotation,
        }
      )
      .then((res) => {
        resolve(`Created new project: ${res.data.id}`);
      })
      .catch((e) => {
        reject(`Error creating project: ${e}`);
      });
  });
};

Which I just copied over from the Python version. That looks like this:

    def create_project(self, project_name, project_type, project_license, annotation):
        data = {
            "name": project_name,
            "type": project_type,
            "license": project_license,
            "annotation": annotation,
        }

        r = requests.post(
            API_URL + "/" + self.url + "/projects?api_key=" + self.__api_key, json=data
        )

        r.raise_for_status()

        if "error" in r.json().keys():
            raise RuntimeError(r.json()["error"])

        return self.project(r.json()["id"].split("/")[-1])

Never mind. I ran that https://api.roboflow.com/iadt/test_training_via_api/1?api_key=****&nocache=true request again, and now it says classes: {lola: 12} as expected :man_shrugging:

No idea what’s going wrong here

These tests you’ve ran are extremely helpful!!

I’ve added these details to the report. One final ask for the report - the images that just gave you the weird result (worked once, didn’t work the other time):

Can you send them to help@roboflow.com?

This way we have the exact examples for testing, reproduction of the issue, and testing after the fix to ensure everything is in order.

Hi Mohamed,

I’ve just sent an email with all the images and annotations I’ve been using, as well as two gists which contain the utilities I use to interact with the Roboflow API, and the wrappers I use for my React client to interact with those functions. Let me know if I can do anything else to help solve this

1 Like

Thank you! We’ve isolated the issue, and have a fix ready for it. It should be pushed live soon. I’ll alert you when its available.

1 Like

@jakewarrenblack the fix is live!! Thank you again for your help, and patience.

I saw your PR too in GitHub - roboflow/roboflow-api-snippets: repo for versioning snippets that show how to use Roboflow APIs

I’ll get it reviewed later today and merged in.

1 Like